Ejemplo n.º 1
0
        private void Awake()
        {
            m_target = (target.GetComponent <ManagedBehaviour>()) ? target.GetComponent <ManagedBehaviour>() : target.AddComponent <ManagedBehaviour>();

            m_target.TriggerEntered2D += delegate(Collider2D arg)
            {
                if (tagMask.Count == 0 || tagMask.Contains(arg.tag))
                {
                    otherCollider = arg;
                    this.Fire("OnTriggerDidEnter");
                }
            };

            m_target.TriggerStayed2D += delegate(Collider2D arg)
            {
                if (tagMask.Count == 0 || tagMask.Contains(arg.tag))
                {
                    otherCollider = arg;
                    this.Fire("OnTriggerDidStay");
                }
            };
            m_target.TriggerExited2D += delegate(Collider2D arg)
            {
                if (tagMask.Count == 0 || tagMask.Contains(arg.tag))
                {
                    otherCollider = arg;
                    this.Fire("OnTriggerDidLeave");
                }
            };
        }
Ejemplo n.º 2
0
        private void Awake()
        {
            m_target = (target.GetComponent<ManagedBehaviour>()) ? target.GetComponent<ManagedBehaviour>() : target.AddComponent<ManagedBehaviour>();

            m_target.TriggerEntered2D += delegate(Collider2D arg)
            {
                if(tagMask.Count == 0 || tagMask.Contains(arg.tag))
                {
                    otherCollider = arg;
                    this.Fire("OnTriggerDidEnter");
                }
            };

            m_target.TriggerStayed2D += delegate(Collider2D arg)
            {
                if(tagMask.Count == 0 || tagMask.Contains(arg.tag))
                {
                    otherCollider = arg;
                    this.Fire("OnTriggerDidStay");
                }
            };
            m_target.TriggerExited2D += delegate(Collider2D arg)
            {
                if(tagMask.Count == 0 || tagMask.Contains(arg.tag))
                {
                    otherCollider = arg;
                    this.Fire("OnTriggerDidLeave");
                }
            };
        }
Ejemplo n.º 3
0
        protected override void OnExecute()
        {
            m_target = (target.GetComponent<ManagedBehaviour>()) ? target.GetComponent<ManagedBehaviour>() : target.AddComponent<ManagedBehaviour>();

            m_target.CollisionEntered += delegate(Collision arg)
            {
                collision = arg;
                this.Fire("OnCollisionDidEnter");
            };

            m_target.CollisionStayed += delegate(Collision arg)
            {
                collision = arg;
                this.Fire("OnCollisionDidStay");
            };

            m_target.CollisionExited += delegate(Collision arg)
            {
                collision = arg;
                this.Fire("OnCollisionDidLeave");
            };
        }
Ejemplo n.º 4
0
        protected override void OnExecute()
        {
            m_target = (target.GetComponent <ManagedBehaviour>()) ? target.GetComponent <ManagedBehaviour>() : target.AddComponent <ManagedBehaviour>();

            m_target.CollisionEntered += delegate(Collision arg)
            {
                collision = arg;
                this.Fire("OnCollisionDidEnter");
            };

            m_target.CollisionStayed += delegate(Collision arg)
            {
                collision = arg;
                this.Fire("OnCollisionDidStay");
            };

            m_target.CollisionExited += delegate(Collision arg)
            {
                collision = arg;
                this.Fire("OnCollisionDidLeave");
            };
        }
Ejemplo n.º 5
0
 public static void Remove(ManagedBehaviour managedBehaviour)
 {
     Remove(CallbackType.UPDATE, managedBehaviour.UpdateMe);
     Remove(CallbackType.FIXED_UPDATE, managedBehaviour.FixedUpdateMe);
     Remove(CallbackType.LATE_UPDATE, managedBehaviour.LateUpdateMe);
 }
Ejemplo n.º 6
0
 public static void Add(ManagedBehaviour managedBehaviour)
 {
     instance.AddCallbackInternal(CallbackType.UPDATE, managedBehaviour.UpdateMe);
     instance.AddCallbackInternal(CallbackType.FIXED_UPDATE, managedBehaviour.FixedUpdateMe);
     instance.AddCallbackInternal(CallbackType.LATE_UPDATE, managedBehaviour.LateUpdateMe);
 }