コード例 #1
0
    public void AddAction(UnitAction action)
    {
        if (remainingActions <= 0)
        {
            return;
        }
        remainingActions--;

        // SET UI
        switch (action.GetActionType())
        {
        case UnitAction.ActionType.FIX:
            FindObjectOfType <GameUI>()?.AddHeroHUDRepair(unitNumber);
            SoundSystem.Instance.PlayHeroConfirmSound(unitNumber);
            break;

        case UnitAction.ActionType.MOVE:
            FindObjectOfType <GameUI>()?.AddHeroHUDMove(unitNumber);
            SoundSystem.Instance.PlayHeroMoveSound(unitNumber);
            TileManager.Instance.OnUnitMovedToTile(action.GetActionTarget(), unitNumber);
            break;
        }

        actions.Add(action);
    }