/// <summary> /// 1. Update hook which ticks every frame /// 2. We need our player to move continuously from any state, so move here /// 3. We can change lanes from any state currently. This is a design decision /// </summary> /// <param name="Owner">Who owns the state</param> public virtual void Update() { //Get inputs from all states CharacterInput.ResetInputs(); CharacterInput.CollectInputs(); //Move the character constantly in z-axis (World - forward axis) controller.ConstantMove(); //Check whether character is grounded controller.GroundCheck(); //Check for right input if (CharacterInput.SwipeRightInput()) { controller.ChangeLane(true); } //Check for left input else if (CharacterInput.SwipeLeftInput()) { controller.ChangeLane(false); } }