void Update() { if (!isInit && !isCollision) { TouchHandle touchHandle = GameObject.Find("Panel").GetComponent <TouchHandle> (); touchHandle.DestroyBridge(transform.parent.gameObject); } }
void OnCollisionExit(Collision col) { Debug.Log("OnCollisionExit "); if (col.gameObject.tag == "Vehicle") { numberVehicle--; if (numberVehicle <= 0) { TouchHandle touchHandle = GameObject.Find("Panel").GetComponent <TouchHandle> (); touchHandle.DestroyBridge(transform.parent.gameObject); } } }