unity-game-engineandroid-augmented-reality

Enable disable and share in unity


i'm making an app to take a picture with an Augmented Reality object on it I'm quite confused, can i make a single button to enable and disable at the same time? I mean, i'm using a button to show an AR object, but i can't disable it .. i already tried using boolean but still it doesn't work, the function only show enable or disable, not both, is it possible?

And i'm trying so i can share my picture on social media, i'm using twitter. But it only show my caption, my picture doesn't include, is there a way? Thanks


Solution

  • Sounds like your issue could be solved using a simple if-statement

    if(AlreadyEnabled)
    {
    ARObject.setActive(false);
    AlreadyEnabled = false;
    }
    else
    {
    ARObject.setActive(true);
    AlreadyEnabled = true;
    }