Пример #1
0
 private void OnFocus()
 {
     WebGLMemorySize        = PlayerSettings.WebGL.memorySize;
     WebGLExceptionSupport  = PlayerSettings.WebGL.exceptionSupport;
     WebGLCompressionFormat = PlayerSettings.WebGL.compressionFormat;
     WebGLDataCaching       = PlayerSettings.WebGL.dataCaching;
     WebGLDebugSymbols      = PlayerSettings.WebGL.debugSymbols;
 }
Пример #2
0
 private void OnEnable()
 {
     BuildSettings.Load();
     WebGLMemorySize        = PlayerSettings.WebGL.memorySize;
     WebGLExceptionSupport  = PlayerSettings.WebGL.exceptionSupport;
     WebGLCompressionFormat = PlayerSettings.WebGL.compressionFormat;
     WebGLDataCaching       = PlayerSettings.WebGL.dataCaching;
     WebGLDebugSymbols      = PlayerSettings.WebGL.debugSymbols;
     for (int j = 0; j < SectionAnimators.Length; j++)
     {
         SectionAnimators [j] = new AnimBool(selectedSection == j, new UnityAction(base.Repaint));
     }
 }
Пример #3
0
        protected override void Reset()
        {
            base.Reset();

#if UNITY_5_5_OR_NEWER
            m_MemorySize        = PlayerSettings.WebGL.memorySize;
            m_DataCaching       = PlayerSettings.WebGL.dataCaching;
            m_Template          = PlayerSettings.WebGL.template;
            m_CompressionFormat = PlayerSettings.WebGL.compressionFormat;
            m_ExceptionSupport  = PlayerSettings.WebGL.exceptionSupport;
            m_DebugSymbols      = PlayerSettings.WebGL.debugSymbols;
#else
            m_MemorySize       = PlayerSettings.GetPropertyInt("memorySize", BuildTargetGroup.WebGL);
            m_DataCaching      = PlayerSettings.GetPropertyBool("dataCaching", BuildTargetGroup.WebGL);
            m_Template         = PlayerSettings.GetPropertyString("template", BuildTargetGroup.WebGL);
            m_ExceptionSupport = (WebGLExceptionSupport)PlayerSettings.GetPropertyInt("exceptionSupport", BuildTargetGroup.WebGL);
#endif
        }
        public void Load()
        {
            // Define 'BUILD_PIPELINE_WEBGL_UNITY_DEFAULT' if you want to set a build location as same as default of Unity Editor
            // But it's buggy because the native doesn't generate the new folder to put a build.
#if BUILD_PIPELINE_WEBGL_UNITY_DEFAULT
            buildPath = PlayerPrefs.GetString(PREFS_SETTINGS_BUILD_PATH, EditorUserBuildSettings.GetBuildLocation(BuildTarget.WebGL));
#else
            buildPath = PlayerPrefs.GetString(PREFS_SETTINGS_BUILD_PATH, string.Empty);
#endif
            nameFormat         = PlayerPrefs.GetString(PREFS_SETTINGS_NAME_FORMAT, "{package}_{date}");
            dateTimeFormat     = PlayerPrefs.GetString(PREFS_SETTINGS_DATE_TIME_FORMAT, "yyyyMMddHHmmss");
            stripMobileWarning = PlayerPrefs.GetString(PREFS_SETTINGS_STRIP_MOBILE_WARNING, bool.FalseString) == bool.TrueString;
            createNewFolder    = PlayerPrefs.GetString(PREFS_SETTINGS_CREATE_NEW_FOLDER, bool.TrueString) == bool.TrueString;
            linkerTarget       = (WebGLLinkerTarget)PlayerPrefs.GetInt(PREFS_SETTINGS_LINKER_TARGET, (int)PlayerSettings.WebGL.linkerTarget);
            memorySize         = PlayerPrefs.GetInt(PREFS_SETTINGS_MEMORY_SIZE, PlayerSettings.WebGL.memorySize);
            compressionFormat  = (WebGLCompressionFormat)PlayerPrefs.GetInt(PREFS_SETTINGS_COMPRESSION_FORMAT, (int)PlayerSettings.WebGL.compressionFormat);
            wasmStreaming      = PlayerPrefs.GetString(PREFS_SETTINGS_WASM_STREAMING, PlayerSettings.WebGL.wasmStreaming ? bool.TrueString : bool.FalseString) == bool.TrueString;
            buildOptions       = (BuildOptions)PlayerPrefs.GetInt(PREFS_SETTINGS_BUILD_OPTIONS, 0);
        }
Пример #5
0
        public ScopeBuildSettings()
        {
            saveTarget = EditorUserBuildSettings.activeBuildTarget;
#if LOCAL_UNITY_2018_1_OR_NEWER
            buildTargetGroup = UnityEditorUserBuildSettings.activeBuildTargetGroup;
#endif

            scriptingImplementation     = B.scriptingBackend;
            il2CppCompilerConfiguration = B.il2CppCompilerConfiguration;
            compressionType             = B.compressionType;
            development             = B.development;
            buildAppBundle          = B.buildAppBundle;
            targetArchitectures     = B.targetArchitectures;
            androidBuildType        = B.androidBuildType;
            WebGL_compressionFormat = B.WebGL_compressionFormat;
            WebGL_linkerTarget      = B.WebGL_linkerTarget;
            WebGL_memorySize        = B.WebGL_memorySize;
            WebGL_exceptionSupport  = B.WebGL_exceptionSupport;
#if UNITY_2019_1_OR_NEWER
            WebGL_threadsSupport = B.WebGL_threadsSupport;
            WebGL_wasmStreaming  = B.WebGL_wasmStreaming;
#endif
        }
Пример #6
0
 /// <summary>
 /// 実行する時に呼び出されます
 /// </summary>
 protected override BuildCommandResult DoRun()
 {
     m_oldFormat = PlayerSettings.WebGL.compressionFormat;
     PlayerSettings.WebGL.compressionFormat = m_format;
     return(Success(m_format.ToString()));
 }
Пример #7
0
 //==============================================================================
 // 関数
 //==============================================================================
 /// <summary>
 /// コンストラクタ
 /// </summary>
 public SetWebGLCompressionFormatCommand(WebGLCompressionFormat format)
 {
     m_format = format;
 }
Пример #8
0
        void PublishSectionGUI()
        {
            if (BeginSettingsBox(6, new GUIContent("Publishing Settings")))
            {
                GUILayout.Label("WebGL", EditorStyles.boldLabel, new GUILayoutOption[0]);
                GUI.changed     = false;
                WebGLMemorySize = EditorGUILayout.IntField("WebGL Memory Size*", WebGLMemorySize);
                if (GUI.changed)
                {
                    WebGLMemorySize = Mathf.Clamp(WebGLMemorySize, 0x10, 0x7ff);
                    PlayerSettings.WebGL.memorySize = WebGLMemorySize;
                }
                GUI.changed           = false;
                WebGLExceptionSupport = (WebGLExceptionSupport)EditorGUILayout.EnumPopup("Enable Exceptions*", PlayerSettings.WebGL.exceptionSupport);
                if (WebGLExceptionSupport == WebGLExceptionSupport.FullWithStacktrace)
                {
                    EditorGUILayout.HelpBox("'Full With Stacktrace' exception will decrease performance and increase browser memory usage. Only use this for debugging purposes, and make sure to test in a 64-bit browser.", MessageType.Warning);
                }
                if (GUI.changed)
                {
                    PlayerSettings.WebGL.exceptionSupport = WebGLExceptionSupport;
                }
                GUI.changed            = false;
                WebGLCompressionFormat = (WebGLCompressionFormat)EditorGUILayout.EnumPopup("Compression Format*", PlayerSettings.WebGL.compressionFormat);
                if (GUI.changed)
                {
                    PlayerSettings.WebGL.compressionFormat = WebGLCompressionFormat;
                }
                GUI.changed      = false;
                WebGLDataCaching = EditorGUILayout.Toggle("Data caching*", WebGLDataCaching);
                if (GUI.changed)
                {
                    PlayerSettings.WebGL.dataCaching = WebGLDataCaching;
                }
                GUI.changed       = false;
                WebGLDebugSymbols = EditorGUILayout.Toggle("Debug Symbols*", WebGLDebugSymbols);
                if (GUI.changed)
                {
                    PlayerSettings.WebGL.debugSymbols = WebGLDebugSymbols;
                }

                EditorGUILayout.Space();
                GUILayout.Label("Permissions", EditorStyles.boldLabel, new GUILayoutOption[0]);
                scrollPos = EditorGUILayout.BeginScrollView(scrollPos, EditorStyles.helpBox, GUILayout.MinHeight(110f));
                if (BuildSettings.Get.permissions.Length != (int)Permissions.Count)
                {
                    System.Array.Resize(ref BuildSettings.Get.permissions, (int)Permissions.Count);
                }
                for (int i = 0; i < BuildSettings.Get.permissions.Length; i++)
                {
                    BuildSettings.Get.permissions[i] = EditorGUILayout.ToggleLeft(((Permissions)i).Name(), BuildSettings.Get.permissions[i]);
                }
                EditorGUILayout.EndScrollView();
                EditorGUILayout.Space();
                GUILayout.Label("Extra Permissions", EditorStyles.boldLabel, new GUILayoutOption[0]);
                GUILayout.Label("(one per line)");
                BuildSettings.Get.permissionsExtra = EditorGUILayout.TextArea(BuildSettings.Get.permissionsExtra, GUILayout.MinHeight(50));
                EditorGUILayout.Space();
                GUILayout.Label("Packing", EditorStyles.boldLabel, new GUILayoutOption[0]);
                BuildSettings.Get.packExtension   = EditorGUILayout.BeginToggleGroup("Pack Extension", BuildSettings.Get.packExtension);
                BuildSettings.Get.updateExtension = EditorGUILayout.BeginToggleGroup("Update", BuildSettings.Get.updateExtension);
                GUI.enabled = BuildSettings.Get.updateExtension;
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(".pem file : " + Path.GetFileName(BuildSettings.Get.pemFile));
                if (GUILayout.Button("Browse..."))
                {
                    string ret = EditorUtility.OpenFilePanel("Select you .pem file", EditorUserBuildSettings.GetBuildLocation(BuildTarget.WebGL), "pem");
                    if (!string.IsNullOrEmpty(ret) && File.Exists(ret))
                    {
                        BuildSettings.Get.pemFile = ret;
                    }
                    if (!File.Exists(BuildSettings.Get.pemFile))
                    {
                        BuildSettings.Get.pemFile = "";
                    }
                }
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndToggleGroup();
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Pack Extension..."))
                {
                    string path = EditorUtility.OpenFolderPanel("Select App Folder", EditorUserBuildSettings.GetBuildLocation(BuildTarget.WebGL), "");
                    if (Directory.Exists(path))
                    {
                        ProgressHelper progress = new ProgressHelper();
                        progress.Reset(1);
                        progress.Step("Building Player - Chrome App", "Packing Extension into .crx file");
                        if (BuildSettings.Get.packExtension)
                        {
                            if (ChromeHelper.PackExtension(path))
                            {
                                EditorUtility.RevealInFinder(path);
                            }
                        }
                        progress.Done();
                    }
                }
                GUILayout.Space(10);
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndToggleGroup();
                ShowSharedNote();
            }
            EndSettingsBox();
        }