Esempio n. 1
0
        /// <summary>
        /// 创建加载场景成功事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的加载场景成功事件。</returns>
        public static LoadSceneSuccessEventArgs Create(GameFramework.Scene.LoadSceneSuccessEventArgs e)
        {
            LoadSceneSuccessEventArgs loadSceneSuccessEventArgs = ReferencePool.Acquire <LoadSceneSuccessEventArgs>();

            loadSceneSuccessEventArgs.SceneAssetName = e.SceneAssetName;
            loadSceneSuccessEventArgs.Duration       = e.Duration;
            loadSceneSuccessEventArgs.UserData       = e.UserData;
            return(loadSceneSuccessEventArgs);
        }
Esempio n. 2
0
        private void OnLoadSceneSuccess(object sender, GameFramework.Scene.LoadSceneSuccessEventArgs e)
        {
            if (!m_SceneOrder.ContainsKey(e.SceneAssetName))
            {
                m_SceneOrder.Add(e.SceneAssetName, 0);
            }

            m_EventComponent.Fire(this, LoadSceneSuccessEventArgs.Create(e));
            RefreshSceneOrder();
        }
Esempio n. 3
0
        private void OnLoadSceneSuccess(object sender, GameFramework.Scene.LoadSceneSuccessEventArgs e)
        {
            m_MainCamera = Camera.main;
            if (SceneManager.GetActiveScene() == m_GameFrameworkScene)
            {
                Scene scene = SceneManager.GetSceneByName(GetSceneName(e.SceneAssetName));
                if (!scene.IsValid())
                {
                    Log.Error("Loaded scene '{0}' is invalid.", e.SceneAssetName);
                    return;
                }

                SceneManager.SetActiveScene(scene);
            }

            m_EventComponent.Fire(this, LoadSceneSuccessEventArgs.Create(e));
        }