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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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