Ejemplo n.º 1
0
        static void Run()
        {
            string pathToAssetServer     = Path.GetFullPath("Assets/AssetBundleManager/Editor/AssetBundleServer.exe");
            string assetBundlesDirectory = Path.Combine(Environment.CurrentDirectory, "AssetBundles");

            KillRunningAssetBundleServer();

            BuildScript.CreateAssetBundleDirectory();
            BuildScript.WriteServerURL();

            string args = assetBundlesDirectory;

            args = string.Format("\"{0}\" {1}", args, Process.GetCurrentProcess().Id);
            ProcessStartInfo startInfo = ExecuteInternalMono.GetProfileStartInfoForMono(MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge"), GetMonoProfileVersion(), pathToAssetServer, args, true);

            startInfo.WorkingDirectory = assetBundlesDirectory;
            startInfo.UseShellExecute  = false;
            Process launchProcess = Process.Start(startInfo);

            if (launchProcess == null || launchProcess.HasExited == true || launchProcess.Id == 0)
            {
                //Unable to start process
                UnityEngine.Debug.LogError("Unable Start AssetBundleServer process");
            }
            else
            {
                //We seem to have launched, let's save the PID
                instance.m_ServerPID = launchProcess.Id;
            }
        }
Ejemplo n.º 2
0
        public static void Run()
        {
            var serverPath = Path.GetFullPath("Assets/Scripts/Framework/AssetManager/Editor/AssetBundleServer.exe");
            var bundlePath = Path.Combine(Environment.CurrentDirectory, "AssetBundles");

            KillRunningAssetBundleServer();

            BuildScript.CreateAssetBundleDirectory();

            var args = bundlePath;

            args = string.Format("\"{0}\" {1}", args, Process.GetCurrentProcess().Id);

            var startInfo = new ProcessStartInfo(serverPath, args);

            startInfo.WorkingDirectory = bundlePath;
            startInfo.UseShellExecute  = false;
            startInfo.CreateNoWindow   = true;

            var launchProcess = Process.Start(startInfo);

            if (launchProcess == null || launchProcess.HasExited == true || launchProcess.Id == 0)
            {
                //Unable to start process
                Logger.LogError("AssetBundleServer::Run: Unable Start AssetBundleServer process");
            }
            else
            {
                //We seem to have launched, let's save the PID
                instance.m_ServerPID = launchProcess.Id;
            }
        }