Example #1
0
 private void SaveConfiguration()
 {
     if (m_Controller.Save())
     {
         Debug.Log("Save configuration success.");
     }
     else
     {
         Debug.LogWarning("Save configuration failure.");
     }
 }
Example #2
0
    public static void BuildIOSAssetBundle()
    {
        AssetBundleBuilderController controller = new AssetBundleBuilderController();

        if (!controller.Load())
        {
            throw new GameFrameworkException("Load configuration failure.");
        }
        else
        {
            Debug.Log("Load configuration success.");
        }

        if (controller.RefreshBuildEventHandler())
        {
            Debug.Log("Set build event success.");
        }
        else
        {
            Debug.LogWarning("Set build event failure.");
        }

        // 生成Directory
        string currentPath = Directory.GetCurrentDirectory();
        string workPath    = currentPath + "/AssetBundle";

        if (!Directory.Exists(workPath))
        {
            Directory.CreateDirectory(workPath);
        }

        controller.OutputDirectory = workPath;

        if (!controller.IsValidOutputDirectory)
        {
            throw new GameFrameworkException(string.Format("Output directory '{0}' is invalid.", controller.OutputDirectory));
        }

        if (!controller.BuildAssetBundles())
        {
            throw new GameFrameworkException("Build AssetBundles failure.");
        }
        else
        {
            Debug.Log("Build AssetBundles success.");
            controller.Save();
        }
    }
Example #3
0
        private static void Run(int?internalResourceVersion, Platform platforms, string outputDirectory, string buildEventHandlerTypeName)
        {
            AssetBundleBuilderController controller = new AssetBundleBuilderController();

            if (!controller.Load())
            {
                throw new GameFrameworkException("Load configuration failure.");
            }
            else
            {
                Debug.Log("Load configuration success.");
            }

            if (platforms != Platform.Undefined)
            {
                controller.Platforms = platforms;
            }

            if (internalResourceVersion.HasValue)
            {
                controller.InternalResourceVersion = internalResourceVersion.Value;
            }

            if (outputDirectory != null)
            {
                controller.OutputDirectory = outputDirectory;
            }

            if (buildEventHandlerTypeName != null)
            {
                controller.BuildEventHandlerTypeName = buildEventHandlerTypeName;
            }

            if (!controller.IsValidOutputDirectory)
            {
                throw new GameFrameworkException(Utility.Text.Format("Output directory '{0}' is invalid.", controller.OutputDirectory));
            }

            if (!controller.BuildAssetBundles())
            {
                throw new GameFrameworkException("Build AssetBundles failure.");
            }
            else
            {
                Debug.Log("Build AssetBundles success.");
                controller.Save();
            }
        }