Example #1
0
 void OnTriggerExit(Collider other)
 {
     //If the other is the occupator, ...
     if(occupator != null && occupator != other.gameObject.GetComponent<CylinderBehaviour>()) {
         //Unbind position.
         occupator.hole = null;
         //The hole no longer is occupied.
         occupator = null;
     }
 }
Example #2
0
 void OnTriggerExit(Collider other)
 {
     if (other.tag.Equals("Cylinder"))
     {
         CylinderBehaviour cb = other.transform.parent.GetComponent<CylinderBehaviour>();
         if(cb == cylinder) {
             cylinder = null;
         }
     }
 }
Example #3
0
 void OnTriggerEnter(Collider other)
 {
     //If the other collider is a cylinder, ...
     if(other.gameObject.GetComponent<CylinderBehaviour>() != null) {
         //If the hole is not occupied, ...
         if(occupator == null) {
             //The hole becomes occupied.
             occupator = other.gameObject.GetComponent<CylinderBehaviour>();
             //Bind position.
             occupator.hole = this;
         }
     }
 }
Example #4
0
 void OnTriggerEnter(Collider other)
 {
     if(other.tag.Equals("Cylinder") && cylinder == null) {
         cylinder = other.transform.parent.GetComponent<CylinderBehaviour>();
     }
 }