Example #1
0
        private void RebuildDetails()
        {
            CustomDetailRoot.Clear();
            DefaultLabel.Clear();

            var bifurcationsProp = CommandItem.CommandProperty.GetChildProperty("bifurcations");

            var count = bifurcationsProp.GetProperty().arraySize;

            for (int i = 0; i < count; i++)
            {
                var bifurcationBox = new VisualElement();

                var item      = bifurcationsProp.GetArrayElementAt(i);
                var labelProp = item.GetChildProperty("label").GetProperty();

                var a = new Foldout();
                a.text = $"「{labelProp.stringValue}」"; // new Label($"「{labelProp.stringValue}」");
                var toggle = a.Q <Toggle>();
                toggle.style.marginBottom    = 0f;
                a.style.marginTop            = 10f;
                toggle.style.backgroundColor = new Color(0, 0, 0, 0.5f);
                bifurcationBox.Add(a);
                DefaultLabel.Add(a);

                var l = new CommandListView(CommandItem.ParentList, item.GetChildProperty("commandList.commands"));
                a.Add(l);

                CustomDetailRoot.Add(bifurcationBox);
            }
        }
Example #2
0
        private void BuildNestedCommandList()
        {
            var commandProp       = CommandItem.CommandProperty;
            var nestedCommandProp = commandProp.GetChildProperty("commandList.commands");

            CustomDetailRoot.Clear();
            var commandListView = new CommandListView(CommandItem.ParentList, nestedCommandProp);

            CustomDetailRoot.Add(commandListView);
        }
Example #3
0
        public override void OnCreated()
        {
            CustomDetailRoot.Clear();

            var commandProp = CommandItem.CommandProperty;

            var containerProp     = commandProp.GetChildProperty("container.commands");
            var containerListView = new CommandListView(CommandItem.ParentList, containerProp);

            CustomDetailRoot.Add(containerListView);
        }
Example #4
0
        public override void OnCreated()
        {
            CustomDetailRoot.Clear();

            var l0 = new Label("ルーチン");

            CustomDetailRoot.Add(l0);

            var commandProp = CommandItem.CommandProperty;

            var trueProp     = commandProp.GetChildProperty("routine.commands");
            var trueListView = new CommandListView(CommandItem.ParentList, trueProp);

            CustomDetailRoot.Add(trueListView);
        }
Example #5
0
        /// <summary>
        /// EventCommandEditorが作成されたときに呼び出されます。
        /// </summary>
        public virtual void OnCreated()
        {
            //ShowListViewInCustomDetailAttributeがついてるEventCommandListをDetailに追加する
            var commandProp = CommandItem.CommandProperty.GetProperty();
            var typeDesc    = commandProp.managedReferenceFullTypename.Split(' ');

            var assemblyName = typeDesc[0];
            var typeName     = typeDesc[1];

            var assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name == assemblyName);

            if (assembly == default)
            {
                return;
            }

            var type = assembly.DefinedTypes.FirstOrDefault(t => t.FullName == typeName);

            if (type == default)
            {
                return;
            }

            var fields = type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
            var field  = fields.FirstOrDefault(f => Enumerable.Any <CustomAttributeData>(f.CustomAttributes,
                                                                                         a => a.AttributeType == typeof(ShowListViewInCustomDetailAttribute)));

            if (field == default)
            {
                return;
            }
            if (field.FieldType != typeof(EventCommandList))
            {
                return;
            }

            var listProp = CommandItem.CommandProperty.GetChildProperty(field.Name);

            if (listProp.GetProperty() == null)
            {
                return;
            }

            var list = new CommandListView(CommandItem.ParentList, listProp.GetChildProperty("commands"));

            CustomDetailRoot.Add(list);
        }
Example #6
0
        public override void OnCreated()
        {
            CustomDetailRoot.Clear();

            var l0 = new Label("真の場合");

            CustomDetailRoot.Add(l0);

            var commandProp = CommandItem.CommandProperty;

            var trueProp     = commandProp.GetChildProperty("ifTrue.commands");
            var trueListView = new CommandListView(CommandItem.ParentList, trueProp);

            CustomDetailRoot.Add(trueListView);

            var l1 = new Label("偽の場合");

            CustomDetailRoot.Add(l1);

            var falseProp     = commandProp.GetChildProperty("ifFalse.commands");
            var falseListView = new CommandListView(CommandItem.ParentList, falseProp);

            CustomDetailRoot.Add(falseListView);
        }