Beispiel #1
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
 // at the given speed and will keep moving until it reaches the destination.
 public void LerpToAtSpeed(Vector2 destination, float speed)
 {
     this.destination = destination;
     velocity         = (destination - mover.GetPosition()).normalized * speed;
     lerping          = true;
 }