Ejemplo n.º 1
0
        private void Setup()
        {
            if (string.IsNullOrEmpty(Prefs.externalResourcesPath) || string.IsNullOrEmpty(Prefs.assetManageConfigGUID))
            {
                return;
            }

            var externalResourcesPath = Prefs.externalResourcesPath;
            var assetManageConfigPath = AssetDatabase.GUIDToAssetPath(Prefs.assetManageConfigGUID);
            var assetManageConfig     = AssetDatabase.LoadMainAssetAtPath(assetManageConfigPath) as AssetManageConfig;

            AssetManageConfig.OnReloadAsObservable().Subscribe(_ => Setup()).AddTo(Disposable);

            assetManageManager = new AssetManageManager();
            assetManageManager.Initialize(externalResourcesPath, assetManageConfig);

            if (!string.IsNullOrEmpty(Prefs.selectionAssetGUID))
            {
                var assetPath = AssetDatabase.GUIDToAssetPath(Prefs.selectionAssetGUID);
                selectionAssetObject = AssetDatabase.LoadMainAssetAtPath(assetPath);

                UpdateViewInfo(selectionAssetObject);
            }

            initialized = true;

            Repaint();
        }
        //----- params -----

        //----- field -----

        //----- property -----

        //----- method -----

        public static void Generate(string externalResourcesPath, AssetManageConfig config)
        {
            var assetManageManager = new AssetManageManager();

            assetManageManager.Initialize(externalResourcesPath, config);

            var manifest = GenerateManifest(assetManageManager);

            ApplyAssetBundleName(assetManageManager, manifest);

            UnityEditorUtility.SaveAsset(manifest);

            AssetDatabase.RemoveUnusedAssetBundleNames();
            AssetDatabase.Refresh();
        }
Ejemplo n.º 3
0
        private void Initialize(string externalResourcesPath, AssetManageConfig assetManageConfig)
        {
            // コンパイルが始まったら閉じる.
            CompileNotification.OnCompileStartAsObservable()
            .Subscribe(_ => Close())
            .AddTo(Disposable);

            assetManageConfig.Optimisation();

            assetManageModel = new AssetManageModel();
            assetManageModel.Initialize();

            assetManageManager = new AssetManageManager();
            assetManageManager.Initialize(externalResourcesPath, assetManageConfig);

            manageAssetView = new ManageAssetView();
            manageAssetView.Initialize(assetManageModel, assetManageManager);

            assetManageModel.OnRequestRepaintAsObservable().Subscribe(_ => Repaint()).AddTo(Disposable);
        }