예제 #1
0
        public override void OnInspectorGUI()
        {
            var settings = (GenesisSettings)target;

            using (var scope = new EditorGUI.ChangeCheckScope())
            {
                for (var i = 0; i < PREFERENCES_DRAWERS.Length; i++)
                {
                    var preferencesDrawer = PREFERENCES_DRAWERS[i];
                    preferencesDrawer.Initialize(settings);
                    preferencesDrawer.DrawHeader(settings);
                    preferencesDrawer.DrawContent(settings);

                    if (i < PREFERENCES_DRAWERS.Length - 1)
                    {
                        EditorGUILayout.Space();
                    }
                }

                if (scope.changed)
                {
                    EditorUtility.SetDirty(settings);
                }
            }

            EditorGUILayout.Space(5);
            EditorGUILayout.LabelField(ACTIONS_TITLE, EditorStyles.boldLabel);
            if (GUILayout.Button(GENERATE_BUTTON_TEXT))
            {
                UnityCodeGenerator.GenerateSingle(settings);
            }
        }
예제 #2
0
 public static void GenerateCSharpProject()
 {
     EditorApplication.ExecuteMenuItem("Assets/Open C# Project");
     UnityCodeGenerator.Generate();
 }