예제 #1
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorGUILayout.PropertyField(cardNumber);
        EditorGUILayout.PropertyField(charTitle);
        EditorGUILayout.PropertyField(charQuote);
        EditorGUILayout.PropertyField(cardIllustrator);
        EditorGUILayout.PropertyField(cardSkills, true, GUILayout.ExpandHeight(true));

        EditorGUILayout.PropertyField(charName);
        EditorGUILayout.PropertyField(classTitle);
        EditorGUILayout.PropertyField(deploymentCost);
        EditorGUILayout.PropertyField(canPromote);
        EditorGUILayout.PropertyField(promotionCost);

        EditorList.ShowColorList(cardColor);
        EditorList.ShowGenderList(charGender);
        EditorList.ShowWeaponList(charWeaponType);
        EditorList.ShowUnitList(unitTypes);

        EditorGUILayout.PropertyField(baseAttack);
        EditorGUILayout.PropertyField(baseSupport);

        EditorList.ShowRangeList(baseRange);


        serializedObject.ApplyModifiedProperties();
    }
    /*
     * Responsible for drawing elements in the inspector panel
     */

    public override void OnInspectorGUI()
    {
        /*
         * Show all variables that we need in the inspector panel by calling the function show. The variables below are bascally all the public variables
         * from the Place_Objects class. To make sure that a nice title and tooltip is showing up I am passing it to function show.
         */
        serializedObject.Update();
        EditorList.Show(serializedObject.FindProperty("i_min_same_parts"), "Min. amount", "Minimum amount of elements placed straight");
        EditorList.Show(serializedObject.FindProperty("i_max_same_parts"), "Max. amount", "Maximum amount of elements placed straight");
        EditorList.Show(serializedObject.FindProperty("player"), "Player", "GameObject where the PlayerScript is attached to");
        EditorList.Show(serializedObject.FindProperty("i_amount_of_objects_prebuilt"), "Amount of subsections", "Amount of subsections that is prebuilt");
        EditorList.Show(serializedObject.FindProperty("collision_distance"), "Distance Collision", "The distance to check for collisions");
        EditorList.Show(serializedObject.FindProperty("bool_place_dependency"), "Instantiate Dependency", "Don't place the dependency of the fork");
        //The arrays for the different building assets
        EditorList.Show(serializedObject.FindProperty("parts_straight_begin"), "Begin elements", "Add all your begin elements", EditorListOption.ListLabel | EditorListOption.Buttons);
        EditorList.Show(serializedObject.FindProperty("parts_straight_forward"), "Elements facing forwards", "Add all your elements facing forwards", EditorListOption.ListLabel | EditorListOption.Buttons);
        EditorList.Show(serializedObject.FindProperty("parts_corner_right"), "Corner Elements Right", "Add all your corners facing to the right side", EditorListOption.ListLabel | EditorListOption.Buttons);
        EditorList.Show(serializedObject.FindProperty("parts_corner_left"), "Corner Elements Left", "Add all your corners facing to the left side", EditorListOption.ListLabel | EditorListOption.Buttons);
        EditorList.Show(serializedObject.FindProperty("parts_corner_fork"), "Fork elements", "Add all your fork elements", EditorListOption.ListLabel | EditorListOption.Buttons);
        EditorList.Show(serializedObject.FindProperty("parts_stairway"), "Stairway elements", "Add all your stairway assets", EditorListOption.ListLabel | EditorListOption.Buttons);
        //EditorUtility.DisplayDialog("Min-Max Error","Please change the max or the min value! ");


        serializedObject.ApplyModifiedProperties();
    }
    //---------------------------------------------------------------------------------------------------------
    void DrawAnimationData(SerializedProperty _eventAnim, ref bool _toBeRemoved, int _idx)
    {
        var    type     = (EventAnimationType)_eventAnim.FindPropertyRelative("m_type").enumValueIndex;
        string typeName = type.ToString();

        bool play = false;
        bool show = m_eventAnimVisibilities [_idx];

        DrawAnimationButtonBar(_eventAnim, typeName, _idx, ref show, ref play, ref _toBeRemoved);
        m_eventAnimVisibilities [_idx] = show;

        EditorGUI.indentLevel++;
        if (show)
        {
            SerializedProperty anims;
            for (int i = 0; i < AnimationData.s_eventAnimMembers.Count; i++)
            {
                anims = _eventAnim.FindPropertyRelative(AnimationData.s_eventAnimMembers [i]);
                if (anims.arraySize <= 0)
                {
                    continue;
                }
                var options = EditorListOption.ListLabel | EditorListOption.ElementLabels | EditorListOption.AllButtons;
                EditorList.Display(anims, options);
            }
        }
        EditorGUI.indentLevel--;

        if (play)
        {
            PlayAnimation(type);
        }
    }
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();

        serializedObject.Update();

        Questions q = (Questions)target;

        GUILayout.BeginHorizontal();
        GUILayout.Label("Question:", GUILayout.Width(70));
        q.Question = EditorGUILayout.TextField(q.Question, GUILayout.Width(140));
        q.name     = q.Question;
        //GUILayout.EndHorizontal();

        //GUILayout.BeginHorizontal();
        GUILayout.Label("Answer:", GUILayout.Width(60));
        q.Answer = EditorGUILayout.TextField(q.Answer, GUILayout.Width(140));
        GUILayout.EndHorizontal();

        GUILayout.Space(5);


        //EditorGUILayout.PropertyField(serializedObject.FindProperty("WrongAnswers"), true);

        EditorList.Show(serializedObject.FindProperty("WrongAnswers"), EditorListOption.NoElementLabels);

        serializedObject.ApplyModifiedProperties();
    }
        /// <summary>
        /// Initializes a new instance of the 'ArgumentOVController' class.
        /// </summary>
        /// <param name="name">Name of the object-valued Argument.</param>
        /// <param name="alias">Alias of the object-valued Argument.</param>
        /// <param name="idxml">IdXML of the object-valued Argument.</param>
        /// <param name="domain">Domain or class name of the object-valued Argument.</param>
        /// <param name="nullAllowed">Indicates whether the object-valued Argument allows null values.</param>
        /// <param name="multipleSelectionAllowed">Indicates whether the object-valued Argument allows multiple values.</param>
        /// <param name="isNavigationalFilter">Indicates whether the object-valued Argument has navigational filtering.</param>
        /// <param name="selectionScenario">Target selection scenario.</param>
        /// <param name="supplementaryInfo">Supplementary information.</param>
        /// <param name="alternateKeyName">AlternateKey's name of the object-valued Argument.</param>
        /// <param name="parent">Parent controller.</param>
        public ArgumentOVController(
            string name,
            string alias,
            string idxml,
            string domain,
            bool nullAllowed,
            bool multiSelectionAllowed,
            bool isNavigationalFilter,
            string selectionScenario,
            DisplaySetController supplementaryInfo,
            string alternateKeyName,
            IUController parent)
            : base(name, alias, idxml, domain, nullAllowed, multiSelectionAllowed, parent)
        {
            mSelectionScenario     = selectionScenario;
            mNavigationalFiltering = isNavigationalFilter;
            if (supplementaryInfo == null)
            {
                // Message that shows the number of selected elements (only in multiselelection).
                DisplaySetController lDisplaySetController = new DisplaySetController();
                SupplementaryInfo = lDisplaySetController;
            }
            else
            {
                // DisplaySet supplementary information.
                SupplementaryInfo = supplementaryInfo;
            }

            this.AlternateKeyName = alternateKeyName;

            mEditors = new EditorList(this);
        }
예제 #6
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorList.Show(serializedObject.FindProperty("Waves"), "Wave");
        serializedObject.ApplyModifiedProperties();
    }
예제 #7
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorGUILayout.PropertyField(serializedObject.FindProperty("gameSceneName"), true);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("menuSceneName"), true);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("uiManager"), true);

        EditorList.Show(serializedObject.FindProperty("breakableBrickPics"), EditorListOption.ListLabel | EditorListOption.Buttons);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("unbreakableBrickPic"), true);

        EditorGUILayout.PropertyField(serializedObject.FindProperty("capsuleDropProbability"), true);
        EditorList.Show(serializedObject.FindProperty("capsulePrizes"), EditorListOption.ListLabel | EditorListOption.Buttons);


        EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumLifes"), true);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("brickPrefab"), true);
        string arkanoidLevelsHelpBox = "" +
                                       "This is a text-based level definition. Each line represents an Arkanoid line. For each line only 10 first chars will be taken into account." +
                                       "Type \"U\" for unbreakable bricks, \"1\" for one-hit bricks, \"2\" for two-hit bricks and \"3\" for three-hit bricks. Any other char will be interpreted as no brick.";

        EditorList.Show(serializedObject.FindProperty("arkanoidLevels"), EditorListOption.ListLabel | EditorListOption.Buttons, arkanoidLevelsHelpBox);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("vBrickOffset"), true);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("hBrickOffset"), true);

        serializedObject.ApplyModifiedProperties();
    }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            var feathersProperty = serializedObject.FindProperty("Feathers");

            EditorList.Show(feathersProperty);
            if (feathersProperty.isExpanded)
            {
                GUILayout.Space(20);
                if (GUILayout.Button("+"))
                {
                    ProcessAddButton();
                }
            }

            serializedObject.ApplyModifiedProperties();

            ShowStats();

            GUILayout.Space(20);
            var style = new GUIStyle(GUI.skin.button);

            style.normal.textColor = Color.red;
            if (GUILayout.Button("Clear All", style))
            {
                ProcessClearButton();
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
                UpdateIds();
            }
        }
예제 #9
0
    public void ShowSoundGroup(SoundGroup soundGroup, SerializedProperty property)
    {
        /*
         * EditorGUILayout.PropertyField(property.FindPropertyRelative("sounds"));
         * if (property.FindPropertyRelative("sounds").isExpanded)
         * {
         *  EditorGUI.indentLevel += 1;
         *  if (property.FindPropertyRelative("sounds").arraySize == 0)
         *  {
         *      EditorGUILayout.BeginHorizontal();
         *      ShowButtons(property.FindPropertyRelative("sounds"), 0);
         *      EditorGUILayout.EndHorizontal();
         *  }
         *  for (int j = 0; j < property.FindPropertyRelative("sounds").arraySize; j++)
         *  {
         *      EditorGUILayout.BeginHorizontal();
         *      EditorGUILayout.PropertyField(property.FindPropertyRelative("sounds").GetArrayElementAtIndex(j), GUIContent.none);
         *      ShowButtons(property.FindPropertyRelative("sounds"), j);
         *      EditorGUILayout.EndHorizontal();
         *  }
         *  EditorGUI.indentLevel -= 1;
         * }
         */
        EditorList.Show(property.FindPropertyRelative("sounds"), EditorListOption.NoSize);

        EditorGUILayout.Slider(property.FindPropertyRelative("volume"), 0, 1);
        EditorGUILayout.PropertyField(property.FindPropertyRelative("deadTime"));
        EditorGUILayout.PropertyField(property.FindPropertyRelative("randomize"));

        if (soundGroup.randomize)
        {
            EditorGUI.indentLevel += 1;
            EditorGUILayout.Slider(property.FindPropertyRelative("pitchRndValue"), 0, 1);
            EditorGUILayout.Slider(property.FindPropertyRelative("volumeRndValue"), 0, 1);
            EditorGUI.indentLevel -= 1;
        }

        EditorGUILayout.PropertyField(property.FindPropertyRelative("interruptible"));
        if (soundGroup.interruptible)
        {
            EditorGUI.indentLevel += 1;
            EditorGUILayout.PropertyField(property.FindPropertyRelative("maxSoursesCount"));
            EditorGUILayout.PropertyField(property.FindPropertyRelative("fadeOutTime"));
            EditorGUI.indentLevel -= 1;
            EditorGUILayout.PropertyField(property.FindPropertyRelative("loop"));
            if (soundGroup.loop)
            {
                EditorGUI.indentLevel += 1;
                EditorGUILayout.PropertyField(property.FindPropertyRelative("loopMode"));
                EditorGUILayout.PropertyField(property.FindPropertyRelative("maxLoopCount"));
                if (soundGroup.loopMode == SoundLoopMode.Crossfade)
                {
                    EditorGUILayout.PropertyField(property.FindPropertyRelative("fadeStartTime"));
                    EditorGUILayout.PropertyField(property.FindPropertyRelative("fadeDuration"));
                }
                EditorGUI.indentLevel -= 1;
            }
        }
    }
        public override void OnInspectorGUI()
        {
            myTarget = (TileAssetObjects)target;

            serializedObject.Update();
            EditorList.Show(serializedObject.FindProperty("tiles"), EditorListOption.Buttons | EditorListOption.ListLabel, EditorListButtonOption.All);
            serializedObject.ApplyModifiedProperties();
        }
예제 #11
0
 public EditorsViewModel()
 {
     if (!DesignerProperties.GetIsInDesignMode(new DependencyObject()) && Editors == null)
     {
         IOCContainer.Instance.Register<IEditorsView>(this);
         Editors = new EditorList();
     }
 }
예제 #12
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorList.Show(serializedObject.FindProperty("pools"), EditorListOption.NoListLabel);

        serializedObject.ApplyModifiedProperties();
    }
예제 #13
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorList.Show(serializedObject.FindProperty("integers"));
     EditorList.Show(serializedObject.FindProperty("vectors"));
     EditorList.Show(serializedObject.FindProperty("colorPoints"));
     EditorList.Show(serializedObject.FindProperty("objects"));
     serializedObject.ApplyModifiedProperties();
 }
예제 #14
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorGUI.BeginDisabledGroup(true);
     EditorGUILayout.PropertyField(scriptName, true, new GUILayoutOption[0]);
     EditorGUI.EndDisabledGroup();
     EditorList.Show(itemsCollectionUI, true);
     serializedObject.ApplyModifiedProperties();
 }
예제 #15
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorList.Show(serializedObject.FindProperty("integers"), EditorListOption.ListSize);
     //EditorList.Show(serializedObject.FindProperty("vectors"));
     EditorList.Show(serializedObject.FindProperty("colorPoints"), EditorListOption.Buttons);
     EditorList.Show(serializedObject.FindProperty("objects"), EditorListOption.ListLabel | EditorListOption.Buttons);
     serializedObject.ApplyModifiedProperties();
 }
예제 #16
0
 void DrawLocalisation()
 {
     EditorGUILayout.LabelField("Localisation", EditorStyles.boldLabel);
     EditorGUILayout.BeginVertical("Box");
     EditorGUI.indentLevel += 1;
     EditorList.Show(_supportedLanguagesProperty, EditorListOption.ListLabel | EditorListOption.Buttons | EditorListOption.AlwaysShowAddButton, addButtonText: "Add Language", addButtonToolTip: "Add Language");
     EditorGUI.indentLevel -= 1;
     EditorGUILayout.EndVertical();
 }
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorGUILayout.PropertyField(serializedObject.FindProperty("showWayPoints"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("showWayPointHandles"));
        EditorList.Show(serializedObject.FindProperty("wayPoints"));
        serializedObject.ApplyModifiedProperties();
    }
예제 #18
0
    public override void OnInspectorGUI()
    {
        m_Object.Update();
        GUILayout.Label("Bullet Pattern Creator", EditorStyles.boldLabel);

        EditorGUILayout.PropertyField(positiveProperties["timeToLive"]);
        EditorGUILayout.PropertyField(direction);
        EditorList.Show(bulletArrays);

        EditorGUILayout.PropertyField(positiveProperties["bulletsPerArray"]);

        EditorGUILayout.PropertyField(offset);
        GUILayout.Label("Origin");
        positiveProperties["origin"].floatValue = EditorGUILayout.Slider(positiveProperties["origin"].floatValue, 0, 360);
        GUILayout.Label("Spawn Radius");
        positiveProperties["spawnRadius"].floatValue = EditorGUILayout.Slider(positiveProperties["spawnRadius"].floatValue, 0, 100);

        GUILayout.Label("Array Bullet Spread");
        positiveProperties["arrayBulletSpread"].floatValue = EditorGUILayout.Slider(positiveProperties["arrayBulletSpread"].floatValue, 0, 360);

        GUILayout.Label("Array Spread");
        positiveProperties["arraySpread"].floatValue = EditorGUILayout.Slider(positiveProperties["arraySpread"].floatValue, 0, 360);


        EditorGUILayout.PropertyField(straightShot);
        EditorGUILayout.PropertyField(positiveProperties["spinSpeed"]);


        EditorGUILayout.PropertyField(speedChange);
        if (positiveProperties["spinSpeed"].floatValue == 0 && speedChange.boolValue == false)
        {
            EditorGUILayout.PropertyField(aimAtPlayer);
        }
        else
        {
            aimAtPlayer.boolValue = false;
        }
        if (speedChange.boolValue == true)
        {
            EditorGUILayout.PropertyField(positiveProperties["timeToLerp"]);
            EditorGUILayout.PropertyField(easeMode);
            EditorGUILayout.PropertyField(positiveProperties["maxSpinSpeed"]);
            EditorGUILayout.PropertyField(spinReversal);
            if (spinReversal.boolValue == true)
            {
                EditorGUILayout.PropertyField(positiveProperties["cycles"]);
            }
        }

        EditorGUILayout.PropertyField(positiveProperties["fireRate"]);

        EditorGUILayout.PropertyField(positiveProperties["bulletSpeed"]);

        CheckPositiveProperties();
        m_Object.ApplyModifiedProperties();
    }
예제 #19
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorList.Show(list = serializedObject.FindProperty("qualityLevels"), EditorListOption.Buttons | EditorListOption.ElementLabels);
     if (GUILayout.Button(new GUIContent("New Graphic Quality", "Add"), EditorStyles.miniButton, GUILayout.Height(25)))
     {
         list.arraySize += 1;
     }
     serializedObject.ApplyModifiedProperties();
 }
예제 #20
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        MagiaList          mTest = (MagiaList)target;
        SerializedProperty list  = serializedObject.FindProperty("magias");

        EditorList.Show(list, EditorListOption.ListLabel | EditorListOption.Buttons);

        serializedObject.ApplyModifiedProperties();
    }
예제 #21
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorList.Show(headsProperty, EditorListOption.Buttons | EditorListOption.ListLabel);
            EditorList.Show(bodiesProperty, EditorListOption.Buttons | EditorListOption.ListLabel);
            EditorList.Show(legsProperty, EditorListOption.Buttons | EditorListOption.ListLabel);

            serializedObject.ApplyModifiedProperties();
        }
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("attribute"));
     EditorGUILayout.PropertyField(serializedObject.FindProperty("majorChallenge"));
     EditorGUILayout.PropertyField(serializedObject.FindProperty("length"));
     EditorGUILayout.PropertyField(serializedObject.FindProperty("difficulty"));
     EditorList.Show(serializedObject.FindProperty("path"), EditorListOption.NoListSize | EditorListOption.Buttons);
     EditorList.Show(serializedObject.FindProperty("elements"), EditorListOption.NoListSize | EditorListOption.Buttons);
     serializedObject.ApplyModifiedProperties();
 }
예제 #23
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorGUILayout.PropertyField(serializedObject.FindProperty("GroupObject"));

        EditorGUILayout.LabelField("Cells");
        EditorList.Show(serializedObject.FindProperty("Cells"), EditorListOption.Buttons);

        serializedObject.ApplyModifiedProperties();
    }
예제 #24
0
 /// <summary>Removes the given row from the grid.</summary>
 /// <param name="gridListIndex">The index of the row to be removed.</param>
 private void RemoveRow(int gridListIndex)
 {
     if (grid != null && gridListIndex > -1 && gridListIndex < grid.Count)
     {
         EditorList list = grid[gridListIndex];
         for (int i = list.Count - 1; i > -1; i--)
         {
             RemoveTile(list, list.list[i]);
         }
         grid.Remove(list);
     }
 }
    /*
     * property drawer 和 editor的区别:
     * 前者操作的是:SerializedProperty。它需要通过函数获取property。
     * 后者操作的是:SerializedObject。只要该物体被选中,此editor就会存在,并保留对数据的引用。 使用EditorGUILayout来管理position。
     */
    public override void OnInspectorGUI()
    {
        serializedObject.Update();        //与组件上的值同步

        EditorList.Show(serializedObject.FindProperty("integers"));
        EditorList.Show(serializedObject.FindProperty("vectors"));
        EditorList.Show(serializedObject.FindProperty("colorPoints"), EditorListOption.All);
        EditorList.Show(serializedObject.FindProperty("objects"));
        EditorList.Show(serializedObject.FindProperty("notAList"));

        serializedObject.ApplyModifiedProperties();        //与组件上的值同步
    }
예제 #26
0
    public override void OnInspectorGUI()
    {
        SeinAtlas atlas = (SeinAtlas)target;

        serializedObject.Update();

        EditorGUILayout.PropertyField(serializedObject.FindProperty("maxWidth"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("maxHeight"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("padding"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("isImageCanRelease"));

        var option = EEditorListOption.ListLabel | EEditorListOption.Buttons;

        EditorList.Show(serializedObject.FindProperty("images"), option);

        EditorGUILayout.PropertyField(serializedObject.FindProperty("saveAfterPack"));
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Pack", GUILayout.Width(80), GUILayout.Height(40)))
        {
            atlas.Pack();
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Save", GUILayout.Width(80), GUILayout.Height(40)))
        {
            atlas.Save();
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Import", GUILayout.Width(80), GUILayout.Height(40)))
        {
            if (atlas != null && atlas.images != null && atlas.images.Length != 0)
            {
                if (EditorUtility.DisplayDialog(
                        "This atlas is not empty",
                        "New atlas will overwrite it !",
                        "Continue",
                        "Cancel"
                        ))
                {
                    DoImport(atlas);
                }
            }
            else
            {
                DoImport(atlas);
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.Label("Final Atlas");
        GUILayout.Label(atlas.atlasTexture);

        serializedObject.ApplyModifiedProperties();
    }
예제 #27
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorGUILayout.PropertyField(m_currencyCount);
        EditorGUILayout.Space(10);

        levelLength = m_level.arraySize;
        EditorList.Show(m_level, m_difficultyBalance);

        serializedObject.ApplyModifiedProperties();
    }
예제 #28
0
 public override void OnInspectorGUI()
 {
     if (GUILayout.Button(refreshButtonContent))
     {
         var palette = target as ColorPaletteSO;
         palette.UpdateDefaults();
     }
     serializedObject.Update();
     EditorList.Show(serializedObject.FindProperty("defaults"), false);
     EditorList.Show(serializedObject.FindProperty("customs"), true);
     serializedObject.ApplyModifiedProperties();
 }
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorList.Show(
         serializedObject.FindProperty("ToolTypeDataMaps"),
         EditorListOption.ButtonsBelow | EditorListOption.ListLabel | EditorListOption.Buttons | EditorListOption.ElementLabels,
         (element, _) => {
         int?enumId = element.FindPropertyRelative("ToolType")?.intValue;
         return(Enum.GetName(typeof(SpiritWorld.Inventories.Items.Tool.Type), enumId));
     }
         );
     serializedObject.ApplyModifiedProperties();
 }
예제 #30
0
    private void HideEditor(EditorList editorName)
    {
        switch (editorName)
        {
        case EditorList.Html:
            uxAjaxTextEditor.Visible = false;
            break;

        case EditorList.PlainText:
            uxTextBox.Visible = false;
            break;
        }
    }
예제 #31
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorList.Show(ints, EditorListOption.AddRemButtons | EditorListOption.MoveButton);
        EditorList.Show(vecs, EditorListOption.AddRemButtons);
        EditorList.Show(parts, EditorListOption.AddRemButtons);
        EditorList.Show(modules, EditorListOption.ElementLabels | EditorListOption.ListLabel | EditorListOption.AddRemButtons);

        //EditorGUILayout.PropertyField(ints, true);
        //EditorGUILayout.PropertyField(vecs, true);
        //EditorGUILayout.PropertyField(parts, true);
        serializedObject.ApplyModifiedProperties();
    }
예제 #32
0
        private string parse(string originalhtml, JObject data, string rootpath, bool isList, string listitemname)
        {

            int idcounter = -1;

            List<DataList> datalist = new List<DataList>();

            List<LabelList> labelList = new List<LabelList>();
            List<EditorList> editorList = new List<EditorList>();



            Regex rgx = new Regex(regexList, RegexOptions.IgnoreCase);
            MatchCollection matches = rgx.Matches(originalhtml);
            if (matches.Count > 0)
            {
                foreach (Match match in matches)
                {
                    idcounter = idcounter + 1;
                    string path = parseListPath(match.ToString());
                    string pt;
                    if (isList)
                    {
                        if (path.Contains('.'))
                        {
                            pt = rootpath + path.Replace(listitemname, "");
                        }
                        else
                        {
                            pt = rootpath;
                        }
                    }
                    else
                    {
                        pt = rootpath + path;
                    }
                    DataList dl = new DataList() { id = idcounter, data = data.SelectToken(path).ToList(), htmloriginal = match.ToString(), origPath = pt, boRender = this };
                    datalist.Add(dl);


                    originalhtml = originalhtml.Replace(dl.htmloriginal, "#" + idcounter + "#");
                }
            }

            Regex rgxlabel = new Regex(regexLabel, RegexOptions.IgnoreCase);
            MatchCollection matcheslabel = rgxlabel.Matches(originalhtml);
            if (matcheslabel.Count > 0)
            {
                foreach (Match match in matcheslabel)
                {
                    idcounter = idcounter + 1;

                    string path = parsePath(match.ToString());
                    string pt;
                    if (isList)
                    {
                        if (path.Contains('.'))
                        {
                            pt = rootpath + path.Replace(listitemname, "");
                        }
                        else
                        {
                            pt = rootpath;
                        }
                    }
                    else
                    {
                        pt = rootpath + path;
                    }
                    LabelList item = new LabelList() { id = idcounter, Path = pt, boRender = this };
                    labelList.Add(item);

                    originalhtml = originalhtml.Replace(match.ToString(), "#" + idcounter + "#");
                }
            }

            Regex rgxEditor = new Regex(regexEditor, RegexOptions.IgnoreCase);
            MatchCollection matcheseditor = rgxEditor.Matches(originalhtml);
            if (matcheseditor.Count > 0)
            {
                foreach (Match match in matcheseditor)
                {
                    idcounter = idcounter + 1;

                    string path = parsePath(match.ToString());

                    string value = "NULL";

                    try
                    {
                        value = data.SelectToken(path).ToString();
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.ToString());
                    }
                    string pt;
                    if (isList)
                    {
                        if (path.Contains('.'))
                        {
                            pt = rootpath + path.Replace(listitemname, "");
                        }
                        else
                        {
                            pt = rootpath;
                        }
                    }
                    else
                    {
                        pt = rootpath + path;
                    }

                    EditorList item = new EditorList() { id = idcounter, Path = pt, Value = value, boRender = this };
                    editorList.Add(item);

                    originalhtml = originalhtml.Replace(match.ToString(), "#" + idcounter + "#");
                }
            }

            foreach (var i in labelList)
            {
                originalhtml = originalhtml.Replace("#" + i.id + "#", i.getHtml());
            }

            foreach (var i in editorList)
            {
                originalhtml = originalhtml.Replace("#" + i.id + "#", i.getHtml());
            }

            foreach (var i in datalist)
            {
                string html = "";
                int cnt = 0;
                foreach (var item in i.data)
                {
                    JObject mydata;
                    if (!item.GetType().Equals(new JObject()))
                    {
                        mydata = new JObject();

                        mydata.Add(i.getname(), item);
                    }
                    else
                    {
                        mydata = item.Value<JObject>();
                    }
                    html = html + parse(i.getHtml(), mydata, i.origPath + "[" + cnt + "]", true, i.getname());
                    cnt = cnt + 1;
                }

                originalhtml = originalhtml.Replace("#" + i.id + "#", html);
            }

            return originalhtml;
        }