示例#1
0
    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();
        }
    }
示例#2
0
    protected virtual void Awake()
    {
        if (instance != null && !object.ReferenceEquals(this, instance))
        {
            DestroyImmediate(gameObject);
            return;
        }

        instance = this;

        Init();

        if (SceneLoadingManager.IsSelfLoading())
        {
            OnSetting();
        }
    }