Пример #1
0
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         RaycastHit hit;
         if (Physics.Raycast(new Ray(transform.position, transform.forward), out hit, hitRange))
         {
             if (hit.collider.gameObject.tag == "Breakable")
             {
                 handeler.SomethingBroke(hit.collider.gameObject);
             }
             //Debug.DrawRay(transform.position, Vector3.forward);
         }
     }
 }
Пример #2
0
 public void BrokeSomething(Collision coll)
 {
     handeler.SomethingBroke(coll.gameObject);
 }