Пример #1
0
            void OnAdded(ECSComponent comp)
            {
                CompRef cref = new CompRef();

                cref.component = comp;
                comp_ref.Add(comp, cref);
                Components.Add(cref);
            }
Пример #2
0
            void OnRemoved(ECSComponent comp)
            {
                CompRef cref;

                comp_ref.TryGetValue(comp, out cref);
                if (cref != null)
                {
                    Components.Remove(cref);
                }
            }
Пример #3
0
        public static void Unregister(ECSComponent comp)
        {
            Pool reg = null;
            Type t   = comp.GetType();

            if (pools_dict.TryGetValue(t, out reg))
            {
                reg.Unregister(comp);
            }
        }
Пример #4
0
        /// <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);
            }
        }
Пример #5
0
 public virtual void Unregister(ECSComponent comp)
 {
 }