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); }
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(); } }