Exemple #1
0
    private void Init(Params buildParams)
    {
        InitBuildParams(buildParams);

        PlayerPrefs.SetInt("IgnoreExecuteInEditMode", 1);

        if (!Directory.Exists(TempAssetsPath))
        {
            AssetDatabase.CreateFolder(Path.GetDirectoryName(TempAssetsPath), Path.GetFileName(TempAssetsPath));
        }

        AssetDatabase.SaveAssets();

        // To save the build state to disk, since entering playmode will destroy this class
        AssetDatabase.CreateAsset(this, BuilderTempPath);

        _scenes      = BuildUtils.CollectBuildScenes();
        _buildAssets = BuildUtils.CollectBuildAssets();

        _lateProcessor = new LateReferenceProcessor(_buildAssets);

        _oldStrippingLevel          = PlayerSettings.strippingLevel;
        _oldScene                   = EditorApplication.currentScene;
        _oldRunInBackground         = Application.runInBackground;
        _oldRunInBackgroundSettings = PlayerSettings.runInBackground;
        _oldAndroidBuildSubtarget   = EditorUserBuildSettings.androidBuildSubtarget;
    }