Example #1
0
 private void OnTouch(Contactable contact)
 {
     if (contact == Target)
     {
         SetTarget(null);
     }
 }
Example #2
0
 public void MoveTo(Contactable contact)
 {
     if (contact != null && Target != contact &&
         Vector3.Distance(transform.position, contact.transform.position) > boundaryRadius + contact.ContactRadius)
     {
         SetTarget(contact);
     }
 }
Example #3
0
 private void RemoveContact(Contactable contact)
 {
     Contacts.Remove(contact);
     if (RadarContactEvent != null)
     {
         RadarContactEvent(this, new RadarContactArgs(contact, true));
     }
 }
Example #4
0
 private void AddContact(Contactable contact)
 {
     Contacts.Add(contact);
     if (RadarContactEvent != null)
     {
         RadarContactEvent(this, new RadarContactArgs(contact, false));
     }
 }
Example #5
0
 private void SetTarget(Contactable contact)
 {
     if (Target != contact)
     {
         Target = contact;
         if (TargetChanged != null)
         {
             TargetChanged(this, EventArgs.Empty);
         }
     }
 }
Example #6
0
        private void OnExit(Contactable contact)
        {
            var res = contact as Resource;

            if (res != null)
            {
                AvailableTargets.Remove(res);
                if (res == Target)
                {
                    SetTarget();
                }
            }
        }
Example #7
0
        private void OnEnter(Contactable contact)
        {
            var res = contact as Resource;

            if (res != null)
            {
                AvailableTargets.Add(res);
                if (Target == null)
                {
                    SetTarget();
                }
            }
        }
 internal static HandleRef getCPtr(Contactable obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Example #9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Contactable obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #10
0
 public RadarContactArgs(Contactable contact, bool removed)
 {
     Contact        = contact;
     ContactRemoved = removed;
 }