void OnAdded(ECSComponent comp) { CompRef cref = new CompRef(); cref.component = comp; comp_ref.Add(comp, cref); Components.Add(cref); }
void OnRemoved(ECSComponent comp) { CompRef cref; comp_ref.TryGetValue(comp, out cref); if (cref != null) { Components.Remove(cref); } }
public static void Unregister(ECSComponent comp) { Pool reg = null; Type t = comp.GetType(); if (pools_dict.TryGetValue(t, out reg)) { reg.Unregister(comp); } }
/// <summary> /// Register component in corresponding pool /// </summary> /// <param name="icomp"></param> public static void Register(ECSComponent comp) { Pool reg = null; Type t = comp.GetType(); if (pools_dict.TryGetValue(t, out reg)) { reg.Register(comp); } else { reg = CreatePool(t); reg.Register(comp); } }
public virtual void Unregister(ECSComponent comp) { }