Exemplo n.º 1
0
        public void OnProgressUpdate(object sender, GameEventArgs e)
        {
            LoadingFormUpdateProgressEventArgs ne = (LoadingFormUpdateProgressEventArgs)e;

            m_LoadingBar.value  = ne.Progress;
            m_LoadInfoText.text = ne.Description;
        }
        private void OnLoadSceneUpdate(object sender, GameEventArgs e)
        {
            LoadSceneUpdateEventArgs ne = (LoadSceneUpdateEventArgs)e;

            if (ne.UserData != this)
            {
                return;
            }

            Log.Info("Load scene '{0}' update, progress '{1}'.", ne.SceneAssetName, ne.Progress.ToString("P2"));

            string description = string.Format("正在加载场景:[{0}],加载进度:[{1}]。", m_SceneName, ne.Progress.ToString("P2"));
            float  progress    = ne.Progress * 100;

            LoadingFormUpdateProgressEventArgs uiArgs = ReferencePool.Acquire <LoadingFormUpdateProgressEventArgs>().Fill(description, progress, null);

            GameEntry.Event.Fire(this, uiArgs);
        }