コード例 #1
0
    // 玩家手指按下操作
    private void OnTouchBegan(GameObject go, PointerEventData eventData)
    {
        if (!TouchEnabled)
        {
            return;
        }

        _isTouchBegan = true;

        Tile tile = go.GetComponent <Tile>();

        if (tile.Unit == ground.CurrentUnit || tile.IsEmpty())
        {
            // 如果可以放置物体...
            ground.CurrentUnit.SetParent(tile);
            ground.CheckLinkSurround(tile);
        }
        else
        {
            // 不能放置物体...
            tile.Unit.ShowCombineInfo();
        }
    }