Example #1
0
        public void CreateMask()
        {
            mask.SetAll(false);

            foreach (var hComponent in hComponents)
            {
                mask[HComponentIDs.Get(hComponent.GetType())] = true;
            }
        }
Example #2
0
        public static C AddHComponent <C>(HActor hActor) where C : HComponent
        {
            C component = null;

            if (!hActor.TryGetComponents <C>(out component))
            {
                component = Activator.CreateInstance <C>();
                hActor.mask[HComponentIDs.Get(typeof(C))] = true;
                hActor.hComponents[typeof(C)]             = component;
                //HSystems.Insert(hActor);
                HEvents <AddedComponent <C> > .AddEvent(new AddedComponent <C>(component, hActor));
            }

            return(component);
        }