Пример #1
0
        private void OnGUI()
        {
            if (_selectedTypeList == null)
            {
                Initialize();
            }

            _selectedTypeList.Render_Basic();

            EditorGUILayout.LabelField("Output", EditorStyles.boldLabel);
            _namespace.Render_Basic();
            _menuPath.Render_Basic();
            GUI.enabled = false;
            string type = EditorGUILayout.TextField(cSelectedTypeTitle, _selectedTypeList.SelectedType?.Name);

            EditorGUILayout.TextField(cEventNameTitle, $"{type?.EnforceFistCharCaptial()}Event");
            EditorGUILayout.TextField(cEventListenerNameTitle, $"{type?.EnforceFistCharCaptial()}EventListener");
            EditorGUILayout.TextField(cUnityEventNameTitle, $"{type?.EnforceFistCharCaptial()}UnityEventListener");
            EditorGUILayout.TextField(cMenuPathTitle, $"{_menuPath.String}/Events");
            GUI.enabled = true;

            if (GUILayout.Button("Save Event"))
            {
                PathString path = new PathString(EditorUtility.SaveFolderPanel("Generation Path", _lastSavePath, type));

                path = path.InsertAtEnd($"{type?.EnforceFistCharCaptial()}.event");
                path.CreateIfNotExistsDirectory();
                _lastSavePath = path.RemoveAtEnd();

                UTEventGeneration.GenerateEventsOfAllTypes(path, type, _namespace.String, $"{_menuPath.String}", _selectedTypeList.SelectedType.Namespace);
                AssetDatabase.Refresh();
            }
        }
Пример #2
0
 void OnGUI()
 {
     _namespace = EditorGUILayout.TextField("Namespace", _namespace);
     _fileName.Render_Basic();
     _saveFileButton.Render_Basic(_fileName.String, cDefaultFileExtension);
 }