예제 #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);
    }
예제 #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);
    }
예제 #3
0
 // 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;
 }