/* void OnTriggerEnter(Collider other) * { * if (other.gameObject.tag == "Bassin") * { * other.GetComponent<Bassin>().RaiseLevel(volume); * Object.Destroy(this.gameObject); * } * * }*/ void OnTriggerStay(Collider other) { if (other.gameObject.tag == "Bassin") { other.GetComponent <Bassin>().RaiseLevel(volume); /* if (gameObject.transform.parent.childCount == 1) * { * Object.Destroy(gameObject.transform.parent.gameObject); * } * else * { * Object.Destroy(this.gameObject); * }*/ //GameObject.FindGameObjectWithTag("Faucet").GetComponent<Faucet>().releaseWater(gameObject); Faucet.releaseWater(gameObject); } }
static void Main(string[] args) { Faucet newFaucet = new Faucet(); Console.ReadKey(); }