示例#1
0
文件: Tile.cs 项目: yulcat/Epic_monad
    void IPointerExitHandler.OnPointerExit(PointerEventData pointerData)
    {
        isHighlight = false;

        FindObjectOfType <UIManager>().DisableTileViewerUI();

        if (IsUnitOnTile())
        {
            ColorChainTilesByUnit.Hide(unitOnTile.GetComponent <Unit>());
        }

        BattleManager battleManager       = FindObjectOfType <BattleManager>();
        BattleData    battleData          = battleManager.battleData;
        List <Unit>   unitsTargetThisTile = battleData.GetUnitsTargetThisTile(this);

        foreach (Unit unit in unitsTargetThisTile)
        {
            unit.HideChainIcon();
        }

        if (battleManager.IsLeftClicked())
        {
            return;
        }
        FindObjectOfType <UIManager>().DisableUnitViewer();

        if (isPreSeleted)
        {
            battleManager.OnMouseExitHandlerFromTile(position);
        }
    }
示例#2
0
文件: Tile.cs 项目: yulcat/Epic_monad
    void IPointerEnterHandler.OnPointerEnter(PointerEventData pointerData)
    {
        isHighlight = true;

        BattleManager battleManager = FindObjectOfType <BattleManager>();
        BattleData    battleData    = battleManager.battleData;

        if (IsUnitOnTile())
        {
            ColorChainTilesByUnit.Show(unitOnTile.GetComponent <Unit>());

            List <Unit> unitsTargetThisTile = battleData.GetUnitsTargetThisTile(this);
            foreach (Unit unit in unitsTargetThisTile)
            {
                unit.ShowChainIcon();
            }

            if (battleManager.IsLeftClicked())
            {
                return;
            }

            FindObjectOfType <UIManager>().UpdateUnitViewer(unitOnTile);
        }

        FindObjectOfType <UIManager>().SetTileViewer(gameObject);

        if (isPreSeleted)
        {
            battleManager.OnMouseEnterHandlerFromTile(position);
        }
    }