Ejemplo n.º 1
0
        public void OnEnable <P1, P2, P3, P4>(Entity component, P1 p1, P2 p2, P3 p3, P4 p4)
        {
            List <object> iOnEnableSystems = this.typeSystems.GetSystems(component.GetType(), typeof(IOnEnableSystem <P1, P2, P3, P4>));

            if (iOnEnableSystems != null)
            {
                for (int i = 0; i < iOnEnableSystems.Count; i++)
                {
                    IOnEnableSystem <P1, P2, P3, P4> aOnEnableSystem = (IOnEnableSystem <P1, P2, P3, P4>)iOnEnableSystems[i];
                    if (aOnEnableSystem == null)
                    {
                        continue;
                    }

                    try
                    {
                        aOnEnableSystem.Run(component, p1, p2, p3, p4);
                    }
                    catch (Exception e)
                    {
                        Log.Error(e);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void OnEnable(Entity component)
        {
            List <object> iOnEnableSystems = this.typeSystems.GetSystems(component.GetType(), typeof(IOnEnableSystem));

            if (iOnEnableSystems != null)
            {
                for (int i = 0; i < iOnEnableSystems.Count; i++)
                {
                    IOnEnableSystem aOnEnableSystem = (IOnEnableSystem)iOnEnableSystems[i];
                    if (aOnEnableSystem == null)
                    {
                        continue;
                    }

                    try
                    {
                        aOnEnableSystem.Run(component);
                    }
                    catch (Exception e)
                    {
                        Log.Error(e);
                    }
                }
            }
        }