/// <summary> /// Author: Denis /// Gets the reference to the scene switch cam /// </summary> private void Update() { if (PlayerSwitchCam == null) { PlayerSwitchCam = GameObject.Find("SwitchCam").GetComponent <SwitchCam>(); } }
void Awake() { if (SwitchCam.ins != null) { DestroyImmediate(this.gameObject); return; } s_ins = this; DontDestroyOnLoad(gameObject); }