void OnMouseUp() { //towerSprite.transform.position = curPosition; if (isEmpty) { //Debug.Log("create"); //towerPrefabScript. managerUIScript.downEnergy(energy); Instantiate(towerPrefab, towerPosition, Quaternion.identity); isEmpty = false; //Instantiate(towerPrefab, getPosition(), Quaternion.identity); } //towerSpriteSelected.transform.position = gameObject.transform.position; towerSpriteSelected.GetComponent <SpriteRenderer>().enabled = false; isDrag = false; }