// compute horizontal velocity, compute jump velocity, animate character void Update() { settings.ComputeVelocity(); settings.SetMoveDir(); settings.SetFaceDir(); settings.AnimateCharacter(); }
/// <summary> /// Manage the current status of the move. /// </summary> private void MoveObjectUpdate() { // get duration if (moveStep == 0) { settings.customMovementIsOn = true; Move(); settings.angle = turnAngle; settings.hasTurnedForMove = false; settings.TurnObject(); totalMoveDuration = Time.time + settings.moveDuration; moveStep = 1; } // move the object else if (moveStep == 1) { if (Time.time >= totalMoveDuration) { moveStep = 2; } else { settings.ComputeVelocity(speed); settings.AnimateCharacter(); settings.MoveCharacter(true); } } // stop moving else if (moveStep == 2) { settings.ComputeVelocity(new Vector2(0, 0)); settings.AnimateCharacter(); settings.MoveCharacter(true); //if (settings.velocity == new Vector2(0, 0)) //{ moveStep = 0; settings.customMovementIsOn = false; enabled = false; //} } }
// compute horizontal velocity, compute jump velocity, animate character void Update() { settings.ComputeVelocity(); settings.AnimateCharacter(); }