Example #1
0
    private void IdleFinish(float secondsOverflow)
    {
        state = State.Lower;
        Vector3 currentPosition = mover.GetPosition();

        target   = currentPosition - Vector3.up * data.heightToRise;
        velocity = UtilPredict.ConstantVelocity(currentPosition,
                                                target, data.secondsOfLowering);
    }
Example #2
0
    private void WarningFinish(float secondsOverflow)
    {
        state = State.Rise;
        Vector3 currentPosition = mover.GetPosition();

        target   = currentPosition + Vector3.up * heightToRise;
        velocity = UtilPredict.ConstantVelocity(currentPosition,
                                                target, data.secondsOfRising);
    }
 // When this method is called, the GameObject moves towards the destination
 // with a velocity to reach the destination in the given amount of seconds.
 public void LerpToInTime(Vector2 destination, float seconds)
 {
     this.destination = destination;
     velocity         = UtilPredict.ConstantVelocity(mover.GetPosition(), destination, seconds);
     lerping          = true;
 }