Пример #1
0
        /////////////////////////////////////////
        public void RegisterFiles()
        {
            var lst = new List <Item>();

            InitID();


            lst.Add(new Item {
                id          = GetID(),
                displayName = S._BuildSceneSet,
                icon        = EditorIcon.icons_processed_sceneset_icon_asset,
                //depth = 1,
            });

            PB.Load();

            foreach (var p in PB.i.profileList)
            {
                lst.Add(new Item {
                    id          = GetID(),
                    displayName = p.profileName,
                    profile     = p,
                });
            }


            m_registerItems = lst;
            ReloadAndSorting();
        }
Пример #2
0
        public static void DrawGUI()
        {
            P.Load();
            PB.Load();
            Styles.Init();

            DrawContentConfig();

            if (s_changed)
            {
                P.Save();
                PB.Save();
                BuildAssistWindow.Repaint();
            }
        }
Пример #3
0
        //static string BuildAssetBundle() {
        //	if( !PB.i.enableAssetBundleBuild ) return string.Empty;

        //	var currentParams = P.GetCurrentParams();
        //	string result = "";

        //	var outputPath = "AssetBundles/" + currentParams.buildTarget.ToString();

        //	if( currentParams.assetBundleOption.Has( P.BUNDLE_OPTION_CLEAR_FILES ) ) {
        //		try {
        //			fs.rm( outputPath, true );
        //		}
        //		catch( Exception e ) {
        //			Debug.LogException( e );
        //		}
        //	}

        //	try {
        //		string[] assetBundleNames = AssetDatabase.GetAllAssetBundleNames();

        //		AssetBundleBuild[] builds = new AssetBundleBuild[ assetBundleNames.Length ];
        //		for( int i = 0; i < builds.Length; i++ ) {
        //			builds[ i ].assetBundleName = assetBundleNames[ i ];
        //			builds[ i ].assetNames = AssetDatabase.GetAssetPathsFromAssetBundle( assetBundleNames[ i ] );
        //		}

        //		fs.mkdir( outputPath );

        //		Debug.Log( "# Start BuildPipeline.BuildAssetBundles:" );
        //		var manifest = BuildPipeline.BuildAssetBundles(
        //				outputPath,
        //				builds,
        //				currentParams.assetBundleOptions,
        //				currentParams.buildTarget );

        //		if( currentParams.assetBundleOption.Has( P.BUNDLE_OPTION_COPY_STREAMINGASSETS ) ) {
        //			for( int i = 0; i < builds.Length; i++ ) {
        //				var p = builds[ i ].assetBundleName;
        //				fs.cp( $"{outputPath}/{p}", $"{Application.streamingAssetsPath}/{p}", true );
        //			}
        //		}

        //		B.CallEvent( typeof( BuildAssistEventAssetBundleBuildPostProcess ) );

        //		AssetDatabase.SaveAssets();
        //		AssetDatabase.Refresh();
        //	}
        //	catch( Exception e ) {
        //		Debug.LogException( e );
        //		throw;
        //	}
        //	return result;
        //}



        public static string Build(int mode)
        {
            Log("Start Build:");
            PB.Load();
            Utils.CallEvent(typeof(Hananoki_BuildStartProcess));

            using (new ScopeBuildExclusionAssets(PB.i.enableExlusionAssets, PB.i.exclusionFileList))
                using (new ScopeBuildSettings())
                    using (new ScopeScriptingDefineSymbols()) {
                        var currentParams = P.GetActiveTargetParams();

                        if (!Application.isBatchMode)
                        {
                            if (EditorUserBuildSettings.activeBuildTarget != currentParams.buildTarget)
                            {
                                EditorUserBuildSettings.SwitchActiveBuildTarget(UnityEditorEditorUserBuildSettings.activeBuildTargetGroup, currentParams.buildTarget);
                            }
                        }

                        var    activeBuildTargetGroup = UnityEditorEditorUserBuildSettings.activeBuildTargetGroup;
                        string symbol = PlayerSettings.GetScriptingDefineSymbolsForGroup(activeBuildTargetGroup);

                        symbol = string.Join(";", symbol, currentParams.scriptingDefineSymbols);

                        PlayerSettings.SetScriptingDefineSymbolsForGroup(activeBuildTargetGroup, symbol);

                        Log($"ActiveBuildTargetGroup: {activeBuildTargetGroup.ToString()}");
                        Log($"ScriptingDefineSymbols: {symbol}");
                        if (mode.Has(0x02))
                        {
                            //BuildAssetBundle();
                            Debug.LogError("BuildAssetBundle is no longer valid");
                        }
                        if (mode.Has(0x01))
                        {
                            BuildPackage();
                        }
                    }

            Log("Exit Build:");

            return("");
        }
Пример #4
0
        /////////////////////////////////////////

        void OnFocus()
        {
            PB.Load();
        }