/// <summary> /// Provide references to other components /// </summary> void Awake() { // get components attached to this gameobject and store their references AttachReferences(GetComponent <FileIOManager>()); if (endAfterLastTrial) { onTrialEnd.AddListener(EndIfLastTrial); } }
/// <summary> /// Provide references to other components /// </summary> void Awake() { if (setAsMainInstance) { instance = this; } if (dontDestroyOnLoadNewScene && Application.isPlaying) { DontDestroyOnLoad(gameObject); } if (endAfterLastTrial) { onTrialEnd.AddListener(EndIfLastTrial); } }
/// <summary> /// Provide references to other components /// </summary> void Awake() { if (setAsMainInstance) { instance = this; } if (dontDestroyOnLoadNewScene && Application.isPlaying) { DontDestroyOnLoad(gameObject); } // get components attached to this gameobject and store their references AttachReferences(GetComponent <FileIOManager>()); if (endAfterLastTrial) { onTrialEnd.AddListener(EndIfLastTrial); } }
/// <summary> /// Provide references to other components /// </summary> void Awake() { if (setAsMainInstance) { if (instance != null && !ReferenceEquals(instance, this)) { Destroy(this.gameObject); return; } instance = this; } if (dontDestroyOnLoadNewScene && Application.isPlaying) { DontDestroyOnLoad(gameObject); } if (endAfterLastTrial) { onTrialEnd.AddListener(EndIfLastTrial); } }