예제 #1
0
        private void OnGUI()
        {
            BuildDataConfig config = Config;

            relativePath = Path.GetDirectoryName(config.FileName);


            using (EditorBuildData.EditorLocalizationValues.BeginScope())
            {
                //    config.Enabled = EditorGUILayout.Toggle(new GUIContent("Enabled", "开启"), config.Enabled);

                //  GUI.enabled = config.Enabled;


                using (var sv = new GUILayout.ScrollViewScope(scrollPos))
                {
                    using (new GUILayout.HorizontalScope())
                    {
                        if (GUILayout.Button("Build Code".Localization()))
                        {
                            EditorBuildData.BuildCode();
                        }
                        if (GUILayout.Button("Build Data".Localization()))
                        {
                            EditorBuildData.BuildData();
                        }
                        if (GUILayout.Button("Build".Localization()))
                        {
                            EditorBuildData.Build();
                        }
                    }

                    GUIUserSettings();

                    using (var checker = new EditorGUI.ChangeCheckScope())
                    {
                        scrollPos = sv.scrollPosition;

                        if (config.Input == null)
                        {
                            config.Input = new InputDataConfig();
                        }
                        DrawInputConfig(config.Input);


                        if (config.OutputCode == null)
                        {
                            config.OutputCode = new BuildCodeConfig();
                        }
                        DrawCodeConfig(config.OutputCode);

                        if (config.Output == null)
                        {
                            config.Output = new OutputDataConfig();
                        }
                        DrawOutputConfig(config.Output);

                        if (checker.changed)
                        {
                            Save();
                        }
                    }
                }
            }
        }
예제 #2
0
 void Save()
 {
     EditorBuildData.SaveSettings();
 }