protected void Update() { //None -> Inited -> PostInited if (_sceneLoadingState == SceneLoadingState.None) { // If there is no previous scene, it is judged as a single scene call _selfLoading = SceneLoadingManager.IsSelfLoading(); if (_selfLoading) { Init(); } } else if (_sceneLoadingState == SceneLoadingState.Inited) { if (_selfLoading) { DoPostInit(); } } else if (_sceneLoadingState == SceneLoadingState.PostInited) { OnUpdate(); } }
protected virtual void Awake() { if (instance != null && !object.ReferenceEquals(this, instance)) { DestroyImmediate(gameObject); return; } instance = this; Init(); if (SceneLoadingManager.IsSelfLoading()) { OnSetting(); } }