Пример #1
0
    static void MakeAssetBundleAndroid()
    {
        CSObjectWrapEditor.Generator.ClearAll();
        CSObjectWrapEditor.Generator.GenAll();

        CreateAssetBundles.ClearLuaFiles();
        CreateAssetBundles.CopyLuaFilesToRes();

        AssetBundleGen.NamedAssetBundleName();
        AssetBundleTool.CreateAndroidAssetBundle();
    }
Пример #2
0
    static void Build(BuildTarget target, string path, BuildOptions opts = BuildOptions.None)
    {
        var watch = new System.Diagnostics.Stopwatch();

        watch.Start();

        ClearAllLuaFiles();
        CopyLuaFilesToRes();

        AssetBundleGen.NamedAssetBundleName();
        AssetBundleTool.CreateAndroidAssetBundle();

        CSObjectWrapEditor.Generator.ClearAll();
        CSObjectWrapEditor.Generator.GenAll();

        // SGK.Database.LoadConfigFromServer();

        // SGK.CharacterConfig.GenerateBattleCharacterConfig();

        /*
         * string UNITY_CACHE_SERVER = System.Environment.GetEnvironmentVariable("UNITY_CACHE_SERVER");
         * if (!string.IsNullOrEmpty(UNITY_CACHE_SERVER)) {
         *  EditorPrefs.SetBool("CacheServerEnabled", false);
         *  EditorPrefs.SetInt("CacheServerMode", 1);
         *  EditorPrefs.SetString("CacheServerIPAddress", UNITY_CACHE_SERVER);
         * }
         */

        string ANDROID_HOME = System.Environment.GetEnvironmentVariable("ANDROID_HOME");

        if (!string.IsNullOrEmpty(ANDROID_HOME))
        {
            EditorPrefs.SetString("AndroidSdkRoot", System.Environment.GetEnvironmentVariable("ANDROID_HOME"));
        }

        BuildPipeline.BuildPlayer(scenes, path, target, opts);
        watch.Stop();
        UnityEngine.Debug.Log(string.Format("build package dela time {0}ms, {1}s, {2}min", watch.ElapsedMilliseconds, watch.ElapsedMilliseconds / 1000, watch.ElapsedMilliseconds / 1000 / 60));
    }
Пример #3
0
 public static void BuildStep2()
 {
     AssetBundleTool.CreateAndroidAssetBundle();
 }