示例#1
0
        public override void Setup(SerializedProperty property, FieldInfo fieldInfo)
        {
            Schema = GetObject <VariableSchema>(property);
            Values = new EditableList <VariableValue>();

            var values = Values.Setup(Schema.Definitions, Schema.Name, EditorHelper.GetTooltip(fieldInfo), true, true, false, true, true, DrawValue, RemoveValue);

            values.onAddDropdownCallback += AddValueDropdown;
        }
        private static EditableList <string> GetCategories()
        {
            if (_categories == null)
            {
                _categories = new EditableList <string>();
                var categories = _categories.Setup(UiPreferences.Instance.ListenerCategories, "Listener Categories", "The list of categories of listeners that Promt Instructions can trigger.", false, true, false, true, true, DrawCategory);
                categories.onAddCallback += AddCategory;
            }

            return(_categories);
        }
示例#3
0
        public override void Setup(SerializedProperty property, FieldInfo fieldInfo)
        {
            Caller = GetObject <InstructionCaller>(property);
            InstructionProperty = property.FindPropertyRelative("Instruction");
            InputsProperty      = property.FindPropertyRelative("Inputs");
            OutputsProperty     = property.FindPropertyRelative("Outputs");
            InputsList          = new EditableList <InstructionVariable>();
            OutputsList         = new EditableList <InstructionVariable>();

            var inputsList = InputsList.Setup(InputsProperty, null, null, false, true, false, true, true);

            OutputsList.Setup(OutputsProperty, null, null, false, true, false, true, true);

            inputsList.drawHeaderCallback += DrawRefreshButton;
        }
示例#4
0
        public SkillsControl(Species species)
        {
            _species = species;
            _skills  = new EditableList <Skill>();
            var list = _skills.Setup(species.Skills, "Skills", "", false, true, false, true, true, DrawSkill);

            list.onAddDropdownCallback += AddSkill;
            list.elementHeightCallback += GetSkillHeight;

            for (var i = 0; i < species.Skills.Count; i++)
            {
                var skill = species.Skills[i];
                SkillAdded(skill);
                RefreshInputs(_inputLists[i], skill.Instruction);
            }
        }