Beispiel #1
0
    public static void RemoveEventListener(EventListener ls)
    {
        if (!ls)
        {
            return;
        }

        var lss = m_globalListeners.Get(ls.name);

        if (lss == null)
        {
            return;
        }

        var ri = lss.IndexOf(ls);

        if (ri < 0)
        {
            return;
        }

        var lst = m_linkedStates[ls.name];

        foreach (var t in lst)
        {
            t.UpdateState(ri, true);
        }

        lss.RemoveAt(ri);
        ls.Destroy();
    }
Beispiel #2
0
 /// <summary>
 /// Called before removing the entity from CRYENGINE's entity system. Do not call directly.
 /// </summary>
 public override void OnRemove()
 {
     Logger.LogInfo("OnRemove");
     EventListener.Destroy();
     components.ForEach(x => x.Removed -= OnComponentRemoved);
     components.Clear();
     handlers.ToList().ForEach(x => x.Destroy());
     handlers.Clear();
     gameObjects.Remove(this);
 }
Beispiel #3
0
 void IGameObjectEventHandler.Destroy()
 {
     Logger.LogInfo("Destroy");
     EventListener.Destroy();
     OnDestroy();
 }