Example #1
0
 private static void OnEditorInitialize()
 {
     EditorUtility.ClearProgressBar();
     BuildScript.GetManifest();
     BuildScript.GetSettings();
     BuildScript.GetBuildRules();
 }
        private static void OnInitialize()
        {
            EditorUtility.ClearProgressBar();
            var settings = BuildScript.GetSettings();

            if (settings.localServer)
            {
                bool isRunning = LaunchLocalServer.IsRunning();
                if (!isRunning)
                {
                    LaunchLocalServer.Run();
                }
                Assets.dataPath = string.Empty;
            }
            else
            {
                bool isRunning = LaunchLocalServer.IsRunning();
                if (isRunning)
                {
                    LaunchLocalServer.KillRunningAssetBundleServer();
                }
                Assets.dataPath = System.Environment.CurrentDirectory;
            }
            Assets.assetBundleMode     = settings.runtimeMode;
            Assets.getPlatformDelegate = BuildScript.GetPlatformName;
            Assets.loadDelegate        = AssetDatabase.LoadAssetAtPath;
        }
Example #3
0
        public static void CopyAssetBundlesTo(string outputPath)
        {
            var files = new[] {
                Versions.Dataname,
                Versions.Filename,
            };

            foreach (var item in files)
            {
                var dest = Application.streamingAssetsPath + "/" + item;
                if (File.Exists(dest))
                {
                    File.Delete(dest);
                }
            }
            var settings = BuildScript.GetSettings();

            if (settings.copyToStreamingAssets)
            {
                if (!Directory.Exists(outputPath))
                {
                    Directory.CreateDirectory(outputPath);
                }
                foreach (var item in files)
                {
                    var src  = outputPath + "/" + item;
                    var dest = Application.streamingAssetsPath + "/" + item;
                    if (File.Exists(src))
                    {
                        File.Copy(src, dest, true);
                    }
                }
            }
        }
Example #4
0
        private static void OnInitialize()
        {
            EditorUtility.ClearProgressBar();
            var settings = BuildScript.GetSettings();

            if (settings.localServer)
            {
                bool isRunning = LaunchLocalServer.IsRunning();
                if (!isRunning)
                {
                    LaunchLocalServer.Run();
                }
                Assets.dataPath = string.Empty;
                var manifest = BuildScript.GetManifest();
                if (string.IsNullOrEmpty(manifest.downloadURL))
                {
                    manifest.downloadURL = "http://127.0.0.1:7888/";
                    EditorUtility.SetDirty(manifest);
                    AssetDatabase.SaveAssets();
                }
            }
            else
            {
                bool isRunning = LaunchLocalServer.IsRunning();
                if (isRunning)
                {
                    LaunchLocalServer.KillRunningAssetBundleServer();
                }
                Assets.dataPath = System.Environment.CurrentDirectory;
            }
            Assets.assetBundleMode     = settings.runtimeMode;
            Assets.getPlatformDelegate = BuildScript.GetPlatformName;
            Assets.loadDelegate        = AssetDatabase.LoadAssetAtPath;
            Debug.Log(Assets.dataPath);
        }
        private static void OnInitialize()
        {
            var settings = BuildScript.GetSettings();

            Assets.basePath     = BuildScript.outputPath + Path.DirectorySeparatorChar;
            Assets.runtimeMode  = settings.runtimeMode;
            Assets.loadDelegate = AssetDatabase.LoadAssetAtPath;
        }
Example #6
0
        private static void OnInitialize()
        {
            var settings = BuildScript.GetSettings();

            Assets.basePath     = System.Environment.CurrentDirectory;
            Assets.runtimeMode  = settings.runtimeMode;
            Assets.loadDelegate = AssetDatabase.LoadAssetAtPath;
            Menu.SetChecked(MenuItems.KRuntimeMode, settings.runtimeMode);
        }
Example #7
0
        private static void EnabledRuntimeMode()
        {
            var settings = BuildScript.GetSettings();

            if (!Menu.GetChecked(KRuntimeMode))
            {
                Menu.SetChecked(KRuntimeMode, true);
                settings.runtimeMode = true;
            }
            else
            {
                Menu.SetChecked(KRuntimeMode, false);
                settings.runtimeMode = false;
            }
        }
Example #8
0
        public void OnPreprocessBuild(BuildTarget target, string path)
        {
            var destination = Path.Combine(Application.streamingAssetsPath, Assets.AssetBundles);

            if (Directory.Exists(destination))
            {
                FileUtil.DeleteFileOrDirectory(destination);
            }
            var settings = BuildScript.GetSettings();

            if (settings.copyToStreamingAssets)
            {
                BuildScript.CopyAssetBundlesTo(Application.streamingAssetsPath);
            }
        }
 private static void OnEditorInitialize()
 {
     BuildScript.GetManifest();
     BuildScript.GetSettings();
     BuildScript.GetBuildRules();
 }