示例#1
0
 public override void GetInputs(List <VariableDefinition> inputs)
 {
     if (InstructionStore.IsInput(IndexVariable))
     {
         inputs.Add(VariableDefinition.Create(IndexVariable.RootName, VariableType.Integer));
     }
 }
示例#2
0
 public override void GetInputs(List <VariableDefinition> inputs)
 {
     if (InstructionStore.IsInput(Target))
     {
         inputs.Add(VariableDefinition.Create <Mover>(Target.RootName));
     }
 }
示例#3
0
 public override void GetInputs(List <VariableDefinition> inputs)
 {
     foreach (var condition in SortConditions)
     {
         if (InstructionStore.IsInput(condition))
         {
             inputs.Add(VariableDefinition.Create(condition.RootName, VariableType.Empty));
         }
     }
 }
示例#4
0
 public override void GetInputs(List <VariableDefinition> inputs)
 {
     foreach (var item in Items)
     {
         if (InstructionStore.IsInput(item.Variables))
         {
             inputs.Add(VariableDefinition.Create(item.Variables.RootName, VariableType.Empty));
         }
     }
 }
示例#5
0
        public override void GetInputs(List <VariableDefinition> inputs)
        {
            for (var i = 0; i < Trainers.Count; i++)
            {
                var trainer = Trainers[i];

                if (InstructionStore.IsInput(trainer))
                {
                    inputs.Add(VariableDefinition.Create("Trainer" + i, VariableType.Store));
                }
            }

            base.GetInputs(inputs);
        }
示例#6
0
        private void DrawVariable(Rect rect, IList list, int index)
        {
            var name       = _variables.GetVariableName(index);
            var value      = _variables.GetVariableValue(index);
            var definition = _variables.Schema != null && index < _variables.Schema.Count ? _variables.Schema[index] : VariableDefinition.Create("", VariableType.Empty);

            using (var changes = new EditorGUI.ChangeCheckScope())
            {
                if (_variables.Owner != null)
                {
                    var variableRect = new Rect(rect.x, rect.y, rect.width - EditorGUIUtility.singleLineHeight, rect.height);
                    var buttonRect   = new Rect(variableRect.xMax, rect.y, EditorGUIUtility.singleLineHeight, rect.height);

                    value = VariableValueDrawer.Draw(variableRect, new GUIContent(name), value, definition);

                    if (_variables.Schema != null)
                    {
                        if (GUI.Button(buttonRect, _refreshButton.Content, GUIStyle.none))
                        {
                            value = _variables.Schema[index].Generate(_variables.Owner).Value;
                        }
                    }
                }
                else
                {
                    value = VariableValueDrawer.Draw(rect, new GUIContent(name), value, definition);
                }

                if (changes.changed)
                {
                    _variables.SetVariableValue(index, value);
                }
            }
        }