Exemplo n.º 1
0
        public Boolean SystemIsEnabled <T>() where T : SystemBase
        {
            var system = FindSystem <T>();

            if (system.Item0 == null)
            {
                return(false);
            }

            return(BitSet256.IsSet(&_globals->Systems, system.Item1));
        }
Exemplo n.º 2
0
            public void OnCharacterDestroy(Character *entity)
            {
                var array   = _f._ISignalOnCharacterDestroySystems;
                var systems = &(_f._globals->Systems);

                for (Int32 i = 0; i < array.Length; ++i)
                {
                    var s = array[i];
                    if (BitSet256.IsSet(systems, s.RuntimeIndex))
                    {
                        s.OnCharacterDestroy(_f, entity);
                    }
                }
            }
Exemplo n.º 3
0
            public void OnProjectileCreated(Projectile *entity)
            {
                var array   = _f._ISignalOnProjectileCreatedSystems;
                var systems = &(_f._globals->Systems);

                for (Int32 i = 0; i < array.Length; ++i)
                {
                    var s = array[i];
                    if (BitSet256.IsSet(systems, s.RuntimeIndex))
                    {
                        s.OnProjectileCreated(_f, entity);
                    }
                }
            }
Exemplo n.º 4
0
            public void OnDamageBefore(DamageData *dmg)
            {
                var array   = _f._ISignalOnDamageBeforeSystems;
                var systems = &(_f._globals->Systems);

                for (Int32 i = 0; i < array.Length; ++i)
                {
                    var s = array[i];
                    if (BitSet256.IsSet(systems, s.RuntimeIndex))
                    {
                        s.OnDamageBefore(_f, dmg);
                    }
                }
            }
Exemplo n.º 5
0
            public void OnTriggerDynamic(DynamicCollisionInfo info)
            {
                var array   = _f._ISignalOnTriggerDynamicSystems;
                var systems = &(_f._globals->Systems);

                for (Int32 i = 0; i < array.Length; ++i)
                {
                    var s = array[i];
                    if (BitSet256.IsSet(systems, s.RuntimeIndex))
                    {
                        s.OnTriggerDynamic(_f, info);
                    }
                }
            }
Exemplo n.º 6
0
            public void OnNavMeshTargetReached(Core.NavMeshAgent *agent, Entity *entity)
            {
                var array   = _f._ISignalOnNavMeshTargetReachedSystems;
                var systems = &(_f._globals->Systems);

                for (Int32 i = 0; i < array.Length; ++i)
                {
                    var s = array[i];
                    if (BitSet256.IsSet(systems, s.RuntimeIndex))
                    {
                        s.OnNavMeshTargetReached(_f, agent, entity);
                    }
                }
            }
Exemplo n.º 7
0
        public void SystemDisable <T>() where T : SystemBase
        {
            var system = FindSystem <T>();

            if (system.Item0 == null)
            {
                return;
            }

            if (BitSet256.IsSet(&_globals->Systems, system.Item1))
            {
                // clear flag
                BitSet256.Clear(&_globals->Systems, system.Item1);

                try {
                    system.Item0.OnDisabled(this);
                } catch (Exception exn) {
                    Log.Exception(exn);
                }
            }
        }