Ejemplo n.º 1
0
 public virtual void OnTriggerExit(Collider other)
 {
     if (attractor != null && other.gameObject.GetInstanceID() == attractor.gameObject.GetInstanceID())
     {
         attractor             = null;
         this.transform.parent = null;
     }
 }
Ejemplo n.º 2
0
 public virtual void OnTriggerEnter(Collider other)
 {
     if (attractor == null)
     {
         IAttractor att = other.transform.parent.GetComponent <IAttractor>();
         if (att != null)
         {
             attractor             = att;
             this.transform.parent = att.gameObject.transform;
         }
     }
 }
Ejemplo n.º 3
0
 private void Awake()
 {
     SetPlanetData();
     _planetAttractor = this.gameObject.GetComponentInParent <IAttractor>();
 }