public void UnsubscribeCollisionEvent(Guid GUID, OnCollisionHandler handler)
 {
     if (onCollisionEventListeners.ContainsKey(GUID))
     {
         onCollisionEventListeners[GUID] -= handler;
     }
 }
        public bool SubscribeCollisionEvent(Guid GUID, OnCollisionHandler handler)
        {
            var subscribed = false;

            if (onCollisionEventListeners.ContainsKey(GUID))
            {
                onCollisionEventListeners[GUID] += handler;
                subscribed = true;
            }

            return subscribed;
        }
        public bool SubscribeCollisionEvent(Guid GUID, OnCollisionHandler handler)
        {
            var subscribed = false;

            if (onCollisionEventListeners.ContainsKey(GUID))
            {
                onCollisionEventListeners[GUID] += handler;
                subscribed = true;
            }

            return(subscribed);
        }
예제 #4
0
    public override void OnUseAbilityPlayer(AbilityInfo info)
    {
        base.OnUseAbilityPlayer(info);
        castBy            = info.team;
        CurrentHookObject = Instantiate(hookObject, info.castBy.transform.position + info.playerForward, Quaternion.identity);
        CurrentHookObject.transform.LookAt(info.castBy.transform.position + (info.playerForward * 5));
        CurrentHookObject.GetComponent <Rigidbody>().velocity = CurrentHookObject.transform.forward * hookSpeed;
        startPos            = CurrentHookObject.transform.position;
        currentLineRenderer = CurrentHookObject.GetComponent <LineRenderer>();
        endPos = CurrentHookObject.transform.position + CurrentHookObject.transform.forward * abilityInfo.range;
        OnCollisionHandler collisionHandler = CurrentHookObject.GetComponent <OnCollisionHandler>();

        collisionHandler.OnCollide += (OnHookCollide);
        collisionHandler.OnTrigger += (OnHookTrigger);
        returning = false;
        launching = false;
    }
예제 #5
0
    //! --------functions--------
    public static Key Subscribe(Timing timing, TagName tagA, TagName tagB, OnCollisionHandler handler)
    {
        Key key = new Key(timing, tagA, tagB);

        if (_handlers.ContainsKey(key))
        {
            _handlers[key] += handler;
        }
        else
        {
            _handlers.Add(key, handler);
#if COL_BUS_DEBUG
            Debug.LogFormat("Key added [{0}] from [{1}]", key.ToString(), StackInfos.GetCallerFullName());
#endif
        }
        return(key);
    }
예제 #6
0
        internal void Destroy()
        {
            // The proxies must be destroyed before calling this.
            Debug.Assert(ProxyCount == 0);

            // Free the proxy array.
            Proxies = null;
            Shape   = null;

            //Velcro: We set the userdata to null here to help prevent bugs related to stale references in GC
            UserData = null;

            BeforeCollision = null;
            OnCollision     = null;
            OnSeparation    = null;
            AfterCollision  = null;

            Body._world.FixtureRemoved?.Invoke(this);

            Body._world.FixtureAdded   = null;
            Body._world.FixtureRemoved = null;
            OnSeparation = null;
            OnCollision  = null;
        }
 public void UnsubscribeCollisionEvent(Guid GUID, OnCollisionHandler handler)
 {
     throw new NotImplementedException();
 }
 public bool SubscribeCollisionEvent(Guid GUID, OnCollisionHandler handler)
 {
     return true;
 }
 public void UnsubscribeCollisionEvent(Guid GUID, OnCollisionHandler handler)
 {
     if (onCollisionEventListeners.ContainsKey(GUID))
     {
         onCollisionEventListeners[GUID] -= handler;
     }
 }
 public void UnsubscribeCollisionEvent(Guid GUID, OnCollisionHandler handler)
 {
     throw new NotImplementedException();
 }
 public bool SubscribeCollisionEvent(Guid GUID, OnCollisionHandler handler)
 {
     return(true);
 }