Search Unity

if SetActiveRecursively problem

Discussion in 'Scripting' started by ZimonIsHim, Apr 24, 2015.

  1. ZimonIsHim

    ZimonIsHim

    Joined:
    Apr 18, 2015
    Posts:
    7
    I have an main menu and i have an button, when I press the button it show the text, but i want it to be like this:
    If it is SetActiveRecursively(false) and i click the button then SetActiveRecursively(true)
    If it is SetActiveRecursively(true) and i click the button then SetActiveRecursively(false)

    This is my code:

    #pragma strict

    var Text : GameObject;

    function CREDITSfunction () {
    Text.SetActiveRecursively(true);
    }
     
  2. hamsterbytedev

    hamsterbytedev

    Joined:
    Dec 9, 2014
    Posts:
    353
  3. ZimonIsHim

    ZimonIsHim

    Joined:
    Apr 18, 2015
    Posts:
    7
  4. hamsterbytedev

    hamsterbytedev

    Joined:
    Dec 9, 2014
    Posts:
    353
    Java isn't THAT much different than C#. Some of the syntax is a little different and it''s looser with standards. Should be pretty easy to convert