コード例 #1
0
ファイル: BehaviorTreeArgsDict.cs プロジェクト: HusKka/NiuNiu
        public BehaviorTreeArgsDict Clone()
        {
            BehaviorTreeArgsDict behaviorTreeArgsDict = new BehaviorTreeArgsDict();

            foreach (KeyValuePair <string, object> keyValuePair in this.dict)
            {
                behaviorTreeArgsDict.Add(keyValuePair.Key, Clone(keyValuePair.Value));
            }
            return(behaviorTreeArgsDict);
        }
コード例 #2
0
        public BehaviorTreeArgsDict GetArgsDict()
        {
            BehaviorTreeArgsDict dict = new BehaviorTreeArgsDict();

            foreach (BTTypeBaseComponent item in gameObject.GetComponents <BTTypeBaseComponent>())
            {
                FieldInfo info = item.GetType().GetField("fieldValue");
                dict.Add(item.fieldName, info.GetValue(item));
            }
            return(dict);
        }