示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         money.addAmount(20);
     }
     else if (Input.GetKeyDown(KeyCode.DownArrow))
     {
         money.subtractAmount(20);
     }
 }
示例#2
0
 public void OnEndDrag(PointerEventData eventData)
 {
     if (moneyBar.moneyValue - price >= 0)
     {
         //throw new System.NotImplementedException();
         //Debug.Log("OnEndDrag");
         Vector3 mousepos = Input.mousePosition;
         //Debug.Log(mousepos);
         mousepos.x = mousepos.x / 49.25f - 4;
         mousepos.y = mousepos.y / 39.4f - 5;
         Instantiate(chosentower, mousepos, Quaternion.Euler(0, 0, 0));
         moneyBar.subtractAmount(price);
     }
 }