Esempio n. 1
0
 //Checks if player can afford tower and shows preview of the tower and range under cursor
 public void OnBeginDrag(PointerEventData eventData)
 {
     selectManager.DeselectTower();
     if (PlayerStats.Gold < towerPrice)
     {
         //TODO Add display message to playerview
         Debug.Log("You don't have enough money");
         eventData.pointerDrag = null;
     }
     else
     {
         previewInstance = (GameObject)Instantiate(previewPrefab, ScreenToWorld(eventData.position), Quaternion.identity);
     }
 }
Esempio n. 2
0
 //closes UI and deselects tower
 void Close()
 {
     selectManager.DeselectTower();
     gameObject.SetActive(false);
 }