Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public override void OnCreated()
 {
     base.OnCreated();
     ActorComponent behavior = AddComponent <ActorComponent>();
 }