private void Awake() { if (instance == null) { instance = this; } else { Debug.Log("Error: More than one instance of Rounds Manager script in action in " + this.gameObject.name); Destroy(this.gameObject); } }
void Awake() { DontDestroyOnLoad(gameObject); if (instance == null) { instance = this; } else { Destroy(this); } }
void Awake() { //if another one of these get rid of this one if (RoundsManager.R == null) { R = this; } else { Destroy(this.gameObject); } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); return; } }
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { RoundsManager manager = RoundsManager.Instance; if (_counter == 1) { manager.textAnimator.GetComponent <Text>().text = "Start"; manager.textAnimator.GetComponent <Animator>().SetTrigger("LastState"); _counter = 3; } else { manager.textAnimator.GetComponent <Text>().text = Convert.ToString(_counter); manager.textAnimator.GetComponent <Animator>().SetTrigger("NextNumber"); _counter -= 1; } }
private void Awake() { current = this; }