예제 #1
0
    // 右键
    void HandleAlternativeTouch()
    {
        GameTile tile = board.GetTile(TouchRay);

        if (tile != null)
        {
            if (Input.GetKey(KeyCode.LeftShift))
            {
                // 生成一个enemy
                if (tile.Content.Type != GameTileContentType.Empty ||
                    enemies.IsEnemyInThisTile(tile))
                {
                    return;
                }

                SpawnEnemy(tile);
            }
            else
            {
                // 设置目标点
                if (isSelectedEnemy && board.ToggleDestination(tile))
                {
                    enemies.SetDestination(tile);
                }
            }
        }
    }