Ejemplo n.º 1
0
        private IEnumerator AimPhase(IPushable pushable, AimLogic aimLogic)
        {
            _visuals.Indicator.enabled = true;
            while (!pushable.IsPushed())
            {
                AimState state = aimLogic.GetCurrentAimState(Time.time);

                _visuals.Indicator.UpdateState(state);
                yield return(null);
            }

            pushable.IsPushed();
            yield return(null);
        }
Ejemplo n.º 2
0
        public IEnumerator LifeCycle()
        {
            IPushable button = _visuals.MainButton;

            while (true)
            {
                //Start
                yield return(new WaitForPushable(button));

                GoToNextState();

                //Aiming
                var logic = new AimLogic(_settings.aim, Time.time);

                yield return(StartCoroutine(AimPhase(button, logic)));

                var state      = logic.GetCurrentAimState(Time.time);
                var trajectory = GetTrajectory(logic, state);

                GoToNextState();

                //Anim
                yield return(StartCoroutine(AnimPhase(trajectory)));

                GoToNextState();

                //Score
                yield return(StartCoroutine(ShowScorePhase(state)));

                //Reset
                Reset();
                yield return(null);

                GoToNextState();
            }
        }