Ejemplo n.º 1
0
        //public virtual bool IsFinished() {
        //	return _finished;
        //}

        public virtual void Finish()
        {
            PopStage();

            _instructionsManager.Stop();
            float totalTime = Time.time - _timeStart;

            QuickVRManager.Log("STAGE FINISHED: " + GetName() + " " + totalTime.ToString("f3"));

            _coManager.StopCoroutineSet(_coSet);
            StopAllCoroutines();

            if (OnFinish != null)
            {
                OnFinish();
            }

            //Look for the nextStage to be executed
            QuickStageBase nextStage = null;

            for (int i = transform.GetSiblingIndex() + 1; !nextStage && i < transform.parent.childCount; i++)
            {
                Transform t = transform.parent.GetChild(i);
                if (t.gameObject.activeInHierarchy)
                {
                    nextStage = transform.parent.GetChild(i).GetComponent <QuickStageBase>();
                }
            }
            if (nextStage)
            {
                nextStage.Init();
            }

            enabled = false;
        }
        protected virtual void CreateStagesMain()
        {
            Transform tStages = transform.CreateChild(ROOT_STAGES_MAIN_NAME);

            _stagesMain = tStages.GetComponent <QuickStageGroup>();

            if (!_stagesMain)
            {
                //Init the default Stages Main
                _stagesMain = tStages.gameObject.AddComponent <QuickStageGroup>();
                QuickStageBase dummy = _stagesMain.transform.CreateChild("DeleteMe").GetOrCreateComponent <QuickStageBase>();
                dummy._maxTimeOut = -1;
            }

            _stagesMain.OnFinish += Finish;
        }
        public virtual void Finish()
        {
            if (_state != State.StagesPost)
            {
                _state = State.StagesPost;

                //Kill the pre and main stages
                _stagesPre.gameObject.SetActive(false);
                _stagesMain.gameObject.SetActive(false);
                QuickSingletonManager.GetInstance <QuickInstructionsManager>().Stop();

                QuickStageBase.ClearStackStages();

                QuickVRManager.Log("Elapsed Time = " + _timeRunning.ToString("f3") + " seconds");
                _stagesPost.Init();
            }
        }
Ejemplo n.º 4
0
        protected override IEnumerator CoUpdate()
        {
            QuickStageBase firstStage = null;

            for (int i = 0; !firstStage && i < transform.childCount; i++)
            {
                Transform tChild = transform.GetChild(i);
                if (tChild.gameObject.activeSelf)
                {
                    firstStage = tChild.GetComponent <QuickStageBase>();
                }
            }

            if (firstStage)
            {
                firstStage.Init();
            }

            while (GetTopStage() != this)
            {
                yield return(null);
            }
        }
Ejemplo n.º 5
0
 private static void PushStage(QuickStageBase stage)
 {
     _stackStages.Push(stage);
 }