Exemplo n.º 1
0
    private void OnTriggerReleased(object sender, ControllerInteractionEventArgs e)
    {
        // Can't do stuff while teleporting.
        if (mover.IsTeleporting)
        {
            return;
        }

        // Debug.Log(hand.ToString() + " trigger released");

        if (hand == Hands.LEFT)
        {
            if (flyer.FlightState == PlayerFlyer.FlightStates.GROUNDED)
            {
                // Stop attacking.
                attacker.StopAttack();
            }
            else if (flyer.FlightState == PlayerFlyer.FlightStates.FLYING)
            {
                // Stop painting dig tiles.
                SetPointer(false);

                digger.StopDig();
            }
        }
        else if (hand == Hands.RIGHT)
        {
            if (summoner.IsSummoning)
            {
                // Stop summoning.
                SetPointer(false);

                summoner.StopSummon();

                // Issue command.
                if (commander.CommandMode == PlayerCommander.CommandModes.MOVE)
                {
                    commander.MoveCommand(destination);
                }
                else if (commander.CommandMode == PlayerCommander.CommandModes.GUARD)
                {
                    commander.GuardCommand(destination);
                }
            }

            if (grabber.IsGrabbing)
            {
                grabber.Drop();
            }
        }
    }