//private bool _animating = false; private void OnEnable() { _collisionState = GetComponent <PlayerCollisionState>(); _controller = GetComponent <ControllableObject>(); // START THE GAME MANAGER, WINDOW MANAGER, AND THE EVENT SYSTEM // They are not used in this script, but they started for the reset of the game. GameManager GM = GameManager.Instance.GetComponent <GameManager>(); WindowManager WM = WindowManager.Instance.GetComponent <WindowManager>(); EventSystemSingleton ESS = EventSystemSingleton.Instance.GetComponent <EventSystemSingleton>(); }
void Awake() { if (instance) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
private void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }