Esempio n. 1
0
        private void ApplyTagValues()
        {
            if (_tagValues.Count == 0)
            {
                return;
            }

            foreach (var keyValue in _tagValues)
            {
                _animationContext.SetTagValue(keyValue.Key, keyValue.Value);
            }
            _tagValues.Clear();
        }
Esempio n. 2
0
        /// <summary>
        /// Set the value of the specified AnimationTag.
        /// </summary>
        /// <param name="tag">The target AnimationTag to be set.</param>
        /// <param name="value">The value the specified tag should be set to.</param>
        public void SetTagValue(AnimationTag tag, bool value)
        {
            //If the engine is shutdown ignore any incoming calls.
            if (_destroyed)
            {
                return;
            }

            if (_dirty)
            {
                Initialize(false);
            }

            if (tag == null)
            {
                throw new ArgumentNullException(nameof(tag));
            }

            var id = tag.Id;

            if (id < 0)
            {
                Log.Error <CharacterAnimator>("Tried to set the value for an invalid AnimationTag on Entity {0}!", Entity.Name);
                return;
            }

            if (CapFramerate)
            {
                _tagValues[id] = value;
            }
            else
            {
                _animationContext.SetTagValue(tag, value);
            }
        }