Пример #1
0
 void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.GetComponent <Gaze_Collision> () != null &&
         collision.gameObject.GetComponent <Gaze_Collision> ().detectCollision)
     {
         gaze_CollisionEventArgs.Sender         = this.gameObject;
         gaze_CollisionEventArgs.CollisionInfo  = collision;
         gaze_CollisionEventArgs.CollisionState = 1;
         Gaze_EventManager.FireCollisionEvent(gaze_CollisionEventArgs);
         //Gaze_EventManager.FireCollisionEvent (new Gaze_CollisionEventArgs (this.gameObject, collision, 1));
     }
 }
 public virtual void OnCollisionExit(Collision collision)
 {
     if (collision.gameObject.GetComponent <Gaze_AbstractCollision> () != null &&
         collision.gameObject.GetComponent <Gaze_AbstractCollision> ().detectCollision)
     {
         gaze_CollisionEventArgs.Sender         = this.gameObject;
         gaze_CollisionEventArgs.CollisionInfo  = collision;
         gaze_CollisionEventArgs.CollisionState = 3;
         Gaze_EventManager.FireCollisionEvent(gaze_CollisionEventArgs);
         //Gaze_EventManager.FireCollisionEvent (new Gaze_CollisionEventArgs (this.gameObject, collision, 3));
         Gaze_CollisionExit();
     }
 }