Пример #1
0
        public void OnGUI()
        {
            // build android project
            build_android_project = EditorGUILayout.Toggle("Build Android Project", build_android_project);

            // option
            if (build_android_project)
            {
                //build_option = (IOSBuildOption)EditorGUILayout.EnumPopup("Option", build_option);
                int selected = Array.IndexOf(option_list, selected_option);
                selected        = EditorGUILayout.Popup("Use Backuped ?", selected, option_list);
                selected_option = option_list[selected];
            }

            // backup info
            // null means rebuild, if not null, print backup info
            if (this.BackupName != null)
            {
                // if backup_project is not current selected project, reload it.
                if (backup_project == null || backup_project.Path != Configuration.Gloable.Eclipse_Project_Backup_Home + "/" + this.BackupName + "/Game")
                {
                    backup_project = new EclipseProject(Configuration.Gloable.Eclipse_Project_Backup_Home + "/" + this.BackupName + "/Game");
                }
                EditorGUILayout.LabelField("Backup Built At: " + this.backup_project.BuildTime);
            }


            if (!build_android_project)
            {
                apply_native_builder = false;
            }

            /*
             *          apply_native_builder = EditorGUILayout.Toggle("Apply NativeBuilder", apply_native_builder);
             *          {
             *                  if(apply_native_builder)
             *                  {
             *                          if(mod_list.Length > 0)
             *                          {
             *                                  int selectedIndex = Array.IndexOf(mod_list, selected_mod);
             *                                  selectedIndex = EditorGUILayout.Popup("Eupe package", selectedIndex, mod_list);
             *                                  this.selected_mod = mod_list[selectedIndex];
             *                          }
             *                          else
             *                          {
             *                                  EditorGUILayout.LabelField("None of .eupe package found, Can't Build.");
             *                          }
             *                  }
             *          }
             *          if(!apply_native_builder)
             *          {
             *                  build_apk = false;
             *          }else{
             *                  build_android_project = true;
             *          }
             *
             *          build_apk = EditorGUILayout.Toggle("Build Apk", build_apk);
             *          if(!build_apk)
             *          {
             *                  run_apk = false;
             *          }else
             *          {
             *                  build_android_project = true;
             *                  apply_native_builder = true;
             *          }
             *
             *          run_apk = EditorGUILayout.Toggle("Run Apk", run_apk);
             *          if(!run_apk)
             *          {
             *          }
             *          else
             *          {
             *                  build_android_project = true;
             *                  apply_native_builder = true;
             *                  build_apk = true;
             *          }
             */

            if (!string.IsNullOrEmpty(this.selected_option))
            {
                if (GUILayout.Button("Build"))
                {
                    var task = new BuildTask_Android(GetBuildLevel(), this.BackupName, this.selected_mod);
                    task.Build();
                }
            }
        }
Пример #2
0
        public void OnGUI()
        {
            // build android project
            // build_android_project = EditorGUILayout.Toggle("Build Android Project", build_android_project);

            // option
            if (build_android_project)
            {
                //build_option = (IOSBuildOption)EditorGUILayout.EnumPopup("Option", build_option);
                int selected = Array.IndexOf(option_list, selected_option);
                selected        = EditorGUILayout.Popup("Use Backuped ?", selected, option_list);
                selected_option = option_list[selected];
            }

            // backup info
            // null means rebuild, if not null, print backup info
            if (this.BackupName != null)
            {
                // if backup_project is not current selected project, reload it.
                if (backup_project == null || backup_project.Path != Configuration.Gloable.Eclipse_Project_Backup_Home + "/" + this.BackupName + "/Game")
                {
                    backup_project = new EclipseProject(Configuration.Gloable.Eclipse_Project_Backup_Home + "/" + this.BackupName + "/Game");
                }
                EditorGUILayout.LabelField("Backup Built At: " + this.backup_project.BuildTime);
            }


            if (!build_android_project)
            {
                apply_native_builder = false;
            }

            /*
             *          apply_native_builder = EditorGUILayout.Toggle("Apply NativeBuilder", apply_native_builder);
             *          {
             *                  if(apply_native_builder)
             *                  {
             *                          if(mod_list.Length > 0)
             *                          {
             *                                  int selectedIndex = Array.IndexOf(mod_list, selected_mod);
             *                                  selectedIndex = EditorGUILayout.Popup("Eupe package", selectedIndex, mod_list);
             *                                  this.selected_mod = mod_list[selectedIndex];
             *                          }
             *                          else
             *                          {
             *                                  EditorGUILayout.LabelField("None of .eupe package found, Can't Build.");
             *                          }
             *                  }
             *          }
             *          if(!apply_native_builder)
             *          {
             *                  build_apk = false;
             *          }else{
             *                  build_android_project = true;
             *          }
             *
             *          build_apk = EditorGUILayout.Toggle("Build Apk", build_apk);
             *          if(!build_apk)
             *          {
             *                  run_apk = false;
             *          }else
             *          {
             *                  build_android_project = true;
             *                  apply_native_builder = true;
             *          }
             *
             *          run_apk = EditorGUILayout.Toggle("Run Apk", run_apk);
             *          if(!run_apk)
             *          {
             *          }
             *          else
             *          {
             *                  build_android_project = true;
             *                  apply_native_builder = true;
             *                  build_apk = true;
             *          }
             */

            // player name
            {
                var productName = PlayerSettings.productName;
                productName = EditorGUILayout.TextField("Product Name", productName);
                PlayerSettings.productName = productName;
            }

            // package name
            {
                var a = PlayerSettings.applicationIdentifier;
                var b = EditorGUILayout.TextField("Package", a);
                //PlayerSettings.applicationIdentifier = b;
                PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, b);
            }

            {
                var list = EditorBuildSettings.scenes;
                foreach (var s in list)
                {
                    var enable = GUILayout.Toggle(s.enabled, s.path);
                    s.enabled = enable;
                }
                EditorBuildSettings.scenes = list;
            }


            if (!string.IsNullOrEmpty(this.selected_option))
            {
                if (GUILayout.Button("Build"))
                {
                    var task = new BuildTask_Android(GetBuildLevel(), this.BackupName, this.selected_mod);
                    task.Build();
                }
            }
            if (GUILayout.Button("Open ProductDirectory"))
            {
                OpenProductDir();
            }
        }