Пример #1
0
        public static void Unregister(ECSComponent comp)
        {
            Pool reg = null;
            Type t   = comp.GetType();

            if (pools_dict.TryGetValue(t, out reg))
            {
                reg.Unregister(comp);
            }
        }
Пример #2
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);
            }
        }