Beispiel #1
0
    protected virtual void Start()
    {
        CameraSetting();

        if (!PreventLoadCallBack && SSSceneManager.Instance != null)
        {
            SSApplication.OnLoaded(gameObject);
        }
    }
Beispiel #2
0
    protected override void Awake()
    {
        base.Awake();

        if (Application.isPlaying)
        {
            if (SSSceneManager.Instance != null)
            {
                SSApplication.OnUnloaded(gameObject);
            }

            Destroy(gameObject);
        }
    }
Beispiel #3
0
    /*
     #if UNITY_EDITOR
     * void OnValidate()
     * {
     *  Rename();
     *  FindCameras();
     *  FindEventSystems();
     * }
     #endif
     */

    protected virtual void Awake()
    {
        /*
         #if UNITY_EDITOR
         * Rename();
         * FindCameras();
         * FindEventSystems();
         #endif
         */
        if (Application.isPlaying && !PreventLoadCallBack && SSSceneManager.Instance != null)
        {
            foreach (Camera cam in m_Cameras)
            {
                AllCameraClearFlags.Add(cam, cam.clearFlags);
                cam.clearFlags = CameraClearFlags.Depth;
            }

            SSApplication.OnLoaded(gameObject);
        }
    }
Beispiel #4
0
    private void CreateLoadingsThenLoadFirstScene()
    {
        m_IsBusy = true;

        if (string.IsNullOrEmpty(m_LoadingSceneName))
        {
            AfterLoading();
            return;
        }

        if (m_LoadingBack == null)
        {
            SSApplication.LoadLevelAdditive(m_LoadingSceneName, m_IsLoadAsync, (GameObject root) =>
            {
                CreateLoadingBack(root);

                CreateLoadingTop();

                AfterLoading();
            });
        }
    }
Beispiel #5
0
    private void LoadScene(string sn, NoParamCallback onLoaded)
    {
        if (m_Dict.ContainsKey(sn))
        {
            ActiveScene(sn);

            onLoaded();
        }
        else
        {
            SSApplication.LoadLevelAdditive(sn, m_IsLoadAsync, (GameObject root) =>
            {
                GameObject scene = root;

                m_Dict.Add(sn, scene);

                scene.transform.parent = m_Scenes.transform;

                OnSceneLoad(scene);

                onLoaded();
            });
        }
    }