Пример #1
0
    void OnMouseDown()
    {
        if (TurnAndPhase.OnAction())
        {
            return;
        }
        if (!Mouse.CheckMouseOutMenu())
        {
            return;
        }
        if (mode)
        {
            switch (TurnAndPhase.type)
            {
            case (int)TurnAndPhase.Type.Move:
                if (Unit.playerPosition == grid)
                {
                    break;
                }
                Unit.playerPosition = grid;
                GameCamera.TrackPlayer();
                player.SendMessage("MovePlayer", root);
                break;

            case (int)TurnAndPhase.Type.Attack:
                if (Unit.GetEnemyNum(grid) == -1)
                {
                    break;
                }
                player.SendMessage("AttackPlayer", grid);
                break;

            case (int)TurnAndPhase.Type.Buff:
                player.SendMessage("BuffPlayer");
                break;

            case (int)TurnAndPhase.Type.Debuff:
                if (Unit.GetEnemyNum(grid) == -1)
                {
                    break;
                }
                player.SendMessage("DebuffPlayer", grid);
                break;

            case (int)TurnAndPhase.Type.Extra:
                Unit.playerPosition = grid;
                GameCamera.TrackDig();
                CutIn.StartCut(player);
                //player.SendMessage("ExtraPlayer");
                break;
            }
        }
    }