void Start( ) { rage = null; progressBar = null; random = new System.Random( ); ResetDifficulty(); if (rage == null && GameObject.Find("RagePanel")) { rage = GameObject.Find("RagePanel").GetComponent <RagePanelController> ( ); progressBar = GameObject.Find("ProgressBarLabelRight").GetComponent <ProgressBarBehaviour> ( ); player = GameObject.Find("Player").GetComponent <PlayerControl> ( ); } //gamejolt API if (GameJolt.API.Manager.Instance.CurrentUser != null) { //user is logged } else { //user is not logged } }
void Start( ) { rage = null; progressBar = null; random = new System.Random ( ); ResetDifficulty (); if ( rage == null && GameObject.Find ( "RagePanel" ) ) { rage = GameObject.Find ( "RagePanel" ).GetComponent<RagePanelController> ( ); progressBar = GameObject.Find ( "ProgressBarLabelRight" ).GetComponent<ProgressBarBehaviour> ( ); player = GameObject.Find ( "Player" ).GetComponent<PlayerControl> ( ); } //gamejolt API if (GameJolt.API.Manager.Instance.CurrentUser != null) { //user is logged } else { //user is not logged } }
void Awake( ) { if ( _instance == null ) { //If I am the first instance, make me the Singleton _instance = this; DontDestroyOnLoad ( this ); } else { //If a Singleton already exists and you find //another reference in scene, destroy it! if ( this != _instance ) Destroy ( this.gameObject ); } if ( rage == null && GameObject.Find ( "RagePanel" ) ) { rage = GameObject.Find ( "RagePanel" ).GetComponent<RagePanelController> ( ); progressBar = GameObject.Find ( "ProgressBarLabelRight" ).GetComponent<ProgressBarBehaviour> ( ); player = GameObject.Find ( "Player" ).GetComponent<PlayerControl> ( ); } }