示例#1
0
        /// <summary>
        /// Run once per frame in order to manage the actor
        /// </summary>
        protected virtual void Update()
        {
            // Process each of the reactors effects
            for (int i = 0; i < _Reactors.Count; i++)
            {
                ReactorAction lReactor = _Reactors[i];
                if (lReactor._IsEnabled && lReactor._IsActive)
                {
                    lReactor.Update();
                }
            }

            // Process each of the active effects
            for (int i = 0; i < _Effects.Count; i++)
            {
                ActorCoreEffect lEffect   = _Effects[i];
                bool            lIsActive = lEffect.Update();

                // If the effect is no longer active, remove it
                if (!lIsActive)
                {
                    _Effects.RemoveAt(i);
                    i--;

                    lEffect.Release();
                }
            }
        }
示例#2
0
        /// <summary>
        /// Run once per frame in order to manage the actor
        /// </summary>
        protected virtual void Update()
        {
            // Process each of the active effects
            for (int i = 0; i < _ActiveEffects.Count; i++)
            {
                ActorCoreEffect lEffect   = _ActiveEffects[i];
                bool            lIsActive = lEffect.Update();

                // If the effect is no longer active, remove it
                if (!lIsActive)
                {
                    _ActiveEffects.RemoveAt(i);
                    i--;

                    lEffect.Release();
                }
            }
        }