Пример #1
0
    // ACTION FUNCTIONS ========================================================

    public static void ExecuteAction()
    {
        Vector2 attackPosition = PreviewManager.GetAttackPosition();

        switch (selectedAction)
        {
        case Action.Gun:
            instance.StartCoroutine(instance.Gun(PlayerMover.instance.gameObject, attackPosition, PlayerMover.instance.gameObject.GetComponent <UnitStatus>().UnitsAlive()));
            break;

        case Action.Frag:
            instance.StartCoroutine(instance.Grenade(PlayerMover.instance.gameObject, attackPosition));
            break;

        case Action.Smoke:
            break;

        case Action.Gas:
            instance.StartCoroutine(instance.GasGrenade(PlayerMover.instance.gameObject, attackPosition));
            break;

        case Action.Knife:
            instance.StartCoroutine(instance.Knife(PlayerMover.instance.gameObject, attackPosition));
            break;

        case Action.Distract:
            instance.StartCoroutine(instance.Grenade(PlayerMover.instance.gameObject, attackPosition, true));
            break;

        case Action.Gauze:
            instance.StartCoroutine(instance.Gauze());
            break;
        }
    }