private void OnTriggerExit(UnityEngine.Collider other) { BaseActor collidee = null; ActorProxy proxy = other.gameObject.GetComponent <ActorProxy>(); if (proxy) { collidee = proxy.Actor; } else { ActorComponent component = other.gameObject.transform.root.gameObject.GetComponent <ActorComponent>(); collidee = component.Actor; } Actor.LeaveIntercept(collidee); }
private void OnTriggerEnter2D(Collider2D collision) { BaseActor collidee = null; ActorProxy proxy = collision.gameObject.GetComponent <ActorProxy>(); if (proxy) { collidee = proxy.Actor; } else { ActorComponent component = collision.gameObject.transform.root.gameObject.GetComponent <ActorComponent>(); if (component) { collidee = component.Actor; } } if (collidee != null) { Actor.EnterIntercept(collidee); } }
public override void OnCreated() { base.OnCreated(); ActorComponent behavior = AddComponent <ActorComponent>(); }