Beispiel #1
0
    public void Land(DestinationMarkerEventArgs dashArgs)
    {
        if (flightState != FlightStates.FLYING)
        {
            return;
        }

        if (dashArgs.target == null)
        {
            Debug.LogError("dashArgs target is null, can't dash");
        }

        Transform playArea = GameManager.Instance.PlayArea;

        playArea.DOKill();

        // Debug.LogWarning("LAND");

        flightState = FlightStates.GROUNDED;

        playArea.DOMove(dashArgs.destinationPosition, FlightDuration).SetEase(Ease.InOutQuad);

        //mover.Dash(dashArgs, FlyingTeleportDuration);

        mover.SetTeleportDistance(mover.GroundTeleportDistance);
    }
 public FlightStateDataViewModel(FlightStates controlledState,
                                 Commanded commanded,
                                 Observed observed)
 {
     State         = controlledState;
     ObservedData  = observed;
     CommandedData = commanded;
 }
Beispiel #3
0
    public void Fly()
    {
        if (flightState != FlightStates.GROUNDED)
        {
            return;
        }

        // Debug.LogWarning("FLY");

        flightState = FlightStates.FLYING;

        Transform playArea = GameManager.Instance.PlayArea;

        Vector3 flyingPosition = playArea.position + new Vector3(0f, FlyingHeight, 0f);

        playArea.DOMove(flyingPosition, FlightDuration).SetEase(Ease.InOutQuad);

        mover.SetTeleportDistance(FlyingTeleportDistance);
    }