Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Enable / disable new UI

Discussion in 'UGUI & TextMesh Pro' started by topofsteel, Sep 24, 2014.

  1. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Is the new UI called in OnGUI still?
    Can I just enable and disable the game objects?
    Is using a GUI camera necessary or can I control visibility with layers?

    the tutorial series hasn't gotten there yet, if it's going to. And the UIBetaTestProject examples are all just full screen persistent UI's. There is no information on now to set them up. Link to a setup guide? Thanks.
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Why don't you just download it and give it a try? Almost all the questions would be answered with a few clicks.
     
  3. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I've downloaded 4.6 beta17 and the UIBetaTestProject. There are no example of activating and deactivating the UI. I appreciate you taking the time to respond. But even the most simple answers to my questions would provide me a starting point. There don't even appear to be any scripts controlling it, other that making it wobble :/
     
  4. abhuva

    abhuva

    Joined:
    Dec 23, 2011
    Posts:
    76
    All depends on how exactly you want that to happen, but deactivating parts of the UI or even the whole UI is as simple as deactivating any other game-object.
    See here: http://docs.unity3d.com/ScriptReference/GameObject.SetActive.html
    Hope this gives you a starting point.

    PS:
    In the UI-Demo Scene, the one with the different tabs, this is also demonstrated. They are doing it through the inspector and the inbuild OnValueChanged tab, but its the same as calling it from an outside script.
     
  5. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Although abhuva already answered, I am quickly going over your questions.

    No.

    Yes.

    You can either use the UI as overlay without camera, or you can use a camera. At least if you use the camera, it is possible to work with layers.

    I am not 100% sure what you mean, but maybe this helps: