void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); SingletonLoader.CheckSingleton(); } else if (Instance != this) { Destroy(gameObject); } }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(MainObject); anim = GetComponent <Animator>(); SingletonLoader.CheckSingleton(); } else if (Instance != this) { Destroy(gameObject); } }