Exemplo n.º 1
0
    public static void OneKeyBuildAllStep2()
    {
        string data = EditorPrefs.GetString(GetPrefsKey(), string.Empty);

        EditorPrefs.DeleteKey(GetPrefsKey());
        if (string.IsNullOrEmpty(data))
        {
            return;
        }

        Debug.Log("Begin JSB OneKeyBuildAllStep2");
        mOneKeyBuildAll = true;
        try
        {
            JsonData jsonData   = JsonMapper.ToObject(data);
            bool     pForMobile = jsonData["pForMobile"].GetBoolean();
            cmd = jsonData["cmd"].GetBoolean();
            EditorUtility.DisplayCancelableProgressBar("OneKeyBuildAll", "GenerateJsInfoConfig", 0.6f);
            GenerateJsInfoConfig();

            if (pForMobile)
            {
                EditorUtility.DisplayCancelableProgressBar("OneKeyBuildAll",
                                                           "Building MOBILE js code,This may take for about 15 MIN...", 0.8f);
                BuildJsCode();
            }
            else
            {
                EditorUtility.DisplayCancelableProgressBar("OneKeyBuildAll",
                                                           "Building EDITOR js code,This may take for about 15 MIN...", 0.8f);
                BuildEditorJsCode();
            }

            MinifyJsCode();
        }
        catch (Exception e)
        {
            Debug.LogError(e);
        }
        finally
        {
            EditorUtility.ClearProgressBar();
            if (!cmd)
            {
                EditorUtility.DisplayDialog("Tip",
                                            "One key build all Success !",
                                            "OK");
            }
        }
        Debug.Log("JSB OneKeyBuildAll Finish");
        if (cmd)
        {
            PlayerSettingTool.OneKeyBuildStep2();
        }
    }
Exemplo n.º 2
0
    private void OnEnable()
    {
        PlayerSettingTool.instance = this;

        _enableJSB   = HasEnableJSBDefine();
        _useJsz      = HasUseJszDefine();
        _minResBuild = IsMinResBuild();
        _resLoadMode = (AssetPipeline.AssetManager.LoadMode)EditorPrefs.GetInt("ResLoadMode", 0);
        if (_gameSettingData == null)
        {
            GetGameSettingData();
        }
    }
Exemplo n.º 3
0
 public static void ShowWindow()
 {
     if (instance == null)
     {
         PlayerSettingTool window = (PlayerSettingTool)EditorWindow.GetWindow(typeof(PlayerSettingTool));
         window.minSize = new Vector2(562, 562);
         window.Show();
         PlayerSettingTool.instance = window;
     }
     else
     {
         PlayerSettingTool.instance.Close();
     }
 }
Exemplo n.º 4
0
 private void OnDisable()
 {
     PlayerSettingTool.instance = null;
 }