Esempio 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;
        }
Esempio n. 2
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);
            }
        }