Ejemplo n.º 1
0
        private void DrawKeywordValue(KeywordValue value)
        {
            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Name");
            value.value = EditorGUILayout.TextField(value.value, GUILayout.MaxWidth(EditorConfig.RegularTextFieldWidth));
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
        }
Ejemplo n.º 2
0
 private void CreateCurrentKeywordValuesList()
 {
     currentKeywordValuesList = EditorUtils.SetupReorderableList("Values", currentKeyword.values, ref currentKeywordValue, (rect, x) =>
     {
         EditorGUI.LabelField(new Rect(rect.x, rect.y, 200, EditorGUIUtility.singleLineHeight), x.value);
     },
                                                                 (x) =>
     {
         currentKeywordValue = x;
     },
                                                                 () =>
     {
         var value = new KeywordValue();
         currentKeyword.values.Add(value);
     },
                                                                 (x) =>
     {
         currentKeywordValue = null;
     });
 }
Ejemplo n.º 3
0
 public KeywordEditor(GameConfiguration config) : base(config)
 {
     keywordList = EditorUtils.SetupReorderableList("Keywords", gameConfig.keywords, ref currentKeyword, (rect, x) =>
     {
         EditorGUI.LabelField(new Rect(rect.x, rect.y, 200, EditorGUIUtility.singleLineHeight), x.name);
     },
                                                    (x) =>
     {
         currentKeyword      = x;
         currentKeywordValue = null;
         CreateCurrentKeywordValuesList();
     },
                                                    () =>
     {
         var keyword = new Keyword();
         gameConfig.keywords.Add(keyword);
     },
                                                    (x) =>
     {
         currentKeyword      = null;
         currentKeywordValue = null;
     });
 }