private void OnMouseDown() { Vector3 xy = Camera.main.ScreenToWorldPoint(Input.mousePosition); xy.z = 0; PopupScript.Create(xy, Random.Range(10, 100) * Random.Range(3, 10), PopupPrefab); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player") { var instance = Instantiate(BloodAnimation, transform.position, Quaternion.identity) as GameObject; int R = Random.Range(10, 100) * Random.Range(3, 10); TowerAttackScript.WasAHit(R); PopupScript.Create(transform.position, R, PopupPrefab); } }