Beispiel #1
0
        /// <summary> 添加一条效果 </summary>
        public void SetEffect(string _key, bool _value)
        {
            GOAPState state = effects.Find(item => item.Key == _key);

            if (state == null)
            {
                effects.Add(new GOAPState(_key, _value));
            }
            else
            {
                state.Value = _value;
            }
        }
Beispiel #2
0
        /// <summary> 添加一条前提条件 </summary>
        public void SetPrecondition(string _key, bool _value)
        {
            GOAPState state = preconditions.Find(item => item.Key == _key);

            if (state == null)
            {
                preconditions.Add(new GOAPState(_key, _value));
            }
            else
            {
                state.Value = _value;
            }
        }