| | |
| | | protected virtual void OnTap(PointerActionInfo pointerActionInfo) |
| | | { |
| | | return; |
| | | var touchInfo = pointerActionInfo as TouchInfo; |
| | | if (touchInfo != null) |
| | | { |
| | | if (m_GameUI.state == State.Normal && !touchInfo.startedOverUI) |
| | | { |
| | | m_GameUI.TrySelectTower(touchInfo); |
| | | } |
| | | else if (m_GameUI.state == State.Building && !touchInfo.startedOverUI) |
| | | { |
| | | m_GameUI.TryMoveGhost(touchInfo, false); |
| | | if (m_GameUI.IsGhostAtValidPosition() && m_GameUI.IsValidPurchase()) |
| | | { |
| | | confirmationButtons.canvasEnabled = true; |
| | | invalidButtons.canvasEnabled = false; |
| | | confirmationButtons.TryMove(touchInfo.currentPosition); |
| | | } |
| | | else |
| | | { |
| | | invalidButtons.canvasEnabled = true; |
| | | invalidButtons.TryMove(touchInfo.currentPosition); |
| | | confirmationButtons.canvasEnabled = false; |
| | | } |
| | | } |
| | | } |
| | | // var touchInfo = pointerActionInfo as TouchInfo; |
| | | // if (touchInfo != null) |
| | | // { |
| | | // if (m_GameUI.state == State.Normal && !touchInfo.startedOverUI) |
| | | // { |
| | | // m_GameUI.TrySelectTower(touchInfo); |
| | | // } |
| | | // else if (m_GameUI.state == State.Building && !touchInfo.startedOverUI) |
| | | // { |
| | | // m_GameUI.TryMoveGhost(touchInfo, false); |
| | | // if (m_GameUI.IsGhostAtValidPosition() && m_GameUI.IsValidPurchase()) |
| | | // { |
| | | // confirmationButtons.canvasEnabled = true; |
| | | // invalidButtons.canvasEnabled = false; |
| | | // confirmationButtons.TryMove(touchInfo.currentPosition); |
| | | // } |
| | | // else |
| | | // { |
| | | // invalidButtons.canvasEnabled = true; |
| | | // invalidButtons.TryMove(touchInfo.currentPosition); |
| | | // confirmationButtons.canvasEnabled = false; |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /// <summary> |