public override void Awake() { #if UNITY_EDITOR if (!Application.isPlaying) { framesSinceLoadedScene = 0; Transform[] transforms = FindObjectsOfType <Transform>(); IIdentifiable[] identifiables = new IIdentifiable[0]; foreach (Transform trs in transforms) { identifiables = trs.GetComponents <IIdentifiable>(); foreach (IIdentifiable identifiable in identifiables) { if (!UniqueIds.Contains(identifiable.UniqueId)) { UniqueIds = UniqueIds.Add(identifiable.UniqueId); } } } return; } // else // { // for (int i = 0; i < gameScenes.Length; i ++) // { // if (!gameScenes[i].use) // { // gameScenes = gameScenes.RemoveAt(i); // i --; // } // } // } #endif base.Awake(); singletons.Remove(GetType()); singletons.Add(GetType(), this); // InitCursor (); AccountManager.lastUsedAccountIndex = 0; if (SceneManager.GetActiveScene().name == "Init") { LoadGameScenes(); } else if (GetSingleton <GameCamera>() != null) { StartCoroutine(OnGameSceneLoadedRoutine()); } lowPassFilterFactor = accelerometerUpdateInterval / lowPassKernelWidthInSeconds; shakeDetectionThreshold *= shakeDetectionThreshold; lowPassValue = InputManager.Acceleration; }
public override void Awake() { #if UNITY_EDITOR if (!Application.isPlaying) { framesSinceLoadedScene = 0; Transform[] transforms = FindObjectsOfType <Transform>(); IIdentifiable[] identifiables = new IIdentifiable[0]; foreach (Transform trs in transforms) { identifiables = trs.GetComponents <IIdentifiable>(); foreach (IIdentifiable identifiable in identifiables) { if (!UniqueIds.Contains(identifiable.UniqueId)) { UniqueIds = UniqueIds.Add(identifiable.UniqueId); } } } return; } // else // { // for (int i = 0; i < gameScenes.Length; i ++) // { // if (!gameScenes[i].use) // { // gameScenes = gameScenes.RemoveAt(i); // i --; // } // } // } #endif base.Awake(); singletons.Remove(GetType()); singletons.Add(GetType(), this); // InitCursor (); AccountManager.lastUsedAccountIndex = 0; if (SceneManager.GetActiveScene().name == "Init") { LoadGameScenes(); } else if (GameCamera.Instance != null) { StartCoroutine(OnGameSceneLoadedRoutine()); } }
public override void Awake() { #if UNITY_EDITOR if (!Application.isPlaying) { Transform[] transforms = FindObjectsOfType <Transform>(); IIdentifiable[] identifiables = new IIdentifiable[0]; foreach (Transform trs in transforms) { identifiables = trs.GetComponents <IIdentifiable>(); foreach (IIdentifiable identifiable in identifiables) { if (!UniqueIds.Contains(identifiable.UniqueId)) { UniqueIds = UniqueIds.Add(identifiable.UniqueId); } } } return; } #endif if (!initialized) { windowSize = new Vector2Int(Screen.width, Screen.height); ClearPlayerStats(); SaveAndLoadManager.RemoveData("Has paused"); initialized = true; } if (cursorEntries.Length > 0) { activeCursorEntry = null; cursorEntriesDict.Clear(); foreach (CursorEntry cursorEntry in cursorEntries) { cursorEntriesDict.Add(cursorEntry.name, cursorEntry); cursorEntry.rectTrs.gameObject.SetActive(false); } Cursor.visible = false; cursorEntriesDict["Default"].SetAsActive(); } base.Awake(); }