Esempio n. 1
0
        /// <summary>
        /// Unregisters a steering behavior.
        /// </summary>
        /// <param name="behavior">The behavior.</param>
        public void UnregisterSteeringBehavior(SteeringComponent behavior)
        {
            _steeringComponents.Remove(behavior);

            var adjuster = behavior as IAdjustUpdateInterval;
            if (adjuster != null && _intervalAdjusters != null)
            {
                _intervalAdjusters.Remove(adjuster);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Registers a steering component.
        /// </summary>
        /// <param name="behavior">The behavior.</param>
        public void RegisterSteeringBehavior(SteeringComponent behavior)
        {
            _steeringComponents.Add(behavior);

            var adjuster = behavior as IAdjustUpdateInterval;
            if (adjuster != null)
            {
                if (_intervalAdjusters == null)
                {
                    _intervalAdjusters = new List<IAdjustUpdateInterval>();
                }

                _intervalAdjusters.Add(adjuster);
            }
        }