Ejemplo n.º 1
0
        void AddLogicParamToList(LogicParam logicParam, ref List <LogicParam> list)
        {
            if (list == null)
            {
                list = new List <LogicParam>();
            }

            list.Add(logicParam);
        }
Ejemplo n.º 2
0
        public static void SetLogicValue(Object obj, string propertyName, LogicParam logicParam)
        {
            var serializedObject = CreateSerializedObject(obj);

            /* key */
            var keyType = serializedObject.FindProperty("key");

            var target = keyType.FindPropertyRelative("target");

            target.enumValueIndex = (int)logicParam.GimmickKey.Target;

            var key = keyType.FindPropertyRelative("key");

            key.stringValue = logicParam.GimmickKey.Key;

            /* logc */
            var prop       = serializedObject.FindProperty(propertyName);
            var statements = prop.FindPropertyRelative("statements");

            statements.arraySize = logicParam.Logic.Statements.Count;

            for (int cnt_i = 0; cnt_i < statements.arraySize; cnt_i++)
            {
                var statement       = statements.GetArrayElementAtIndex(cnt_i);
                var singleStatement = statement.FindPropertyRelative("singleStatement");

                var inSingleStatement = logicParam.Logic.Statements[cnt_i].SingleStatement;

                /* targetState */
                var targetState = singleStatement.FindPropertyRelative("targetState");
                targetState.FindPropertyRelative("target").enumValueIndex        = (int)inSingleStatement.TargetState.Target;
                targetState.FindPropertyRelative("key").stringValue              = inSingleStatement.TargetState.Key;
                targetState.FindPropertyRelative("parameterType").enumValueIndex = (int)inSingleStatement.TargetState.ParameterType;

                /* expression */
                var expression = singleStatement.FindPropertyRelative("expression");

                SetExpression(inSingleStatement.Expression, expression);
            }

            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 3
0
 public void AddItemLogicParam(LogicParam logicParam)
 {
     AddLogicParamToList(logicParam, ref itemLogicParamList);
 }