Exemple #1
0
        protected override void load(int version, string agentType, List<property_t> properties)
        {
            base.load(version, agentType, properties);

            for (int i = 0; i < properties.Count; ++i)
            {
                property_t p = properties[i];
                if (p.name == "TransitionPhase")
                {
                    if (p.value == "ETP_Exit")
                    {
                        this.m_transitionPhase = ETransitionPhase.ETP_Exit;
                    }
                    else if (p.value == "ETP_Success")
                    {
                        this.m_transitionPhase = ETransitionPhase.ETP_Success;
                    }
                    else if (p.value == "ETP_Failure")
                    {
                        this.m_transitionPhase = ETransitionPhase.ETP_Failure;
                    }
                    else if (p.value == "ETP_Always")
                    {
                        this.m_transitionPhase = ETransitionPhase.ETP_Always;
                    }
                    else
                    {
                        Debug.Check(false);
                    }
                }
            }

        }
Exemple #2
0
        protected override void load(int version, string agentType, List <property_t> properties)
        {
            base.load(version, agentType, properties);

            for (int i = 0; i < properties.Count; ++i)
            {
                property_t p = properties[i];

                if (p.name == "TransitionPhase")
                {
                    if (p.value == "ETP_Exit")
                    {
                        this.m_transitionPhase = ETransitionPhase.ETP_Exit;
                    }
                    else if (p.value == "ETP_Success")
                    {
                        this.m_transitionPhase = ETransitionPhase.ETP_Success;
                    }
                    else if (p.value == "ETP_Failure")
                    {
                        this.m_transitionPhase = ETransitionPhase.ETP_Failure;
                    }
                    else if (p.value == "ETP_Always")
                    {
                        this.m_transitionPhase = ETransitionPhase.ETP_Always;
                    }
                    else
                    {
                        Debug.Check(false);
                    }
                }
            }
        }
Exemple #3
0
        private IEnumerator CRLoadSceneInBackground(string sceneName)
        {
            yield return(null); // continue running on the next frame

            AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(sceneName);

            asyncOperation.allowSceneActivation = false;

            while (!asyncOperation.isDone)
            {
                float progress = asyncOperation.progress + 0.1f;

                OnLoadProgressUpdate?.Invoke(progress);

                // activate the new scene when progress is complete
                if (progress >= 1f)
                {
                    transitionsObject.SetActive(true);
                    asyncOperation.allowSceneActivation = true;
                }

                yield return(null);
            }

            OnLoadProgressUpdate = null;
            TransitionPhase      = ETransitionPhase.In;
        }