Ejemplo n.º 1
0
    void OnEnable()
    {
        try
        {
            save = true;
            if (!Directory.Exists(ABPackHelper.BUILD_PATH))
            {
                Directory.CreateDirectory(ABPackHelper.BUILD_PATH);
            }
            if (!Directory.Exists(ABPackHelper.BUILD_PATH + LuaConst.osDir))
            {
                Directory.CreateDirectory(ABPackHelper.BUILD_PATH + LuaConst.osDir);
            }
            Instance   = this;
            abTypeMaps = new Dictionary <string, string>();
            ABData.datas.Clear();
//#if !UNITY_IOS
//            SVNHelper.UpdateVersion();
//#endif
//            // 拷贝资源版本号
//#if UNITY_IOS
//            var destVersionPath = ABPackHelper.VERSION_PATH + "version_ios.txt";
//#else
//            var destVersionPath = ABPackHelper.VERSION_PATH + "version.txt";
//#endif
//            if (!File.Exists(destVersionPath)) destVersionPath = ABPackHelper.ASSET_PATH + LuaConst.osDir + "/version.txt";
//            var versionPath = ABPackHelper.BUILD_PATH + LuaConst.osDir + "/version.txt";
//            File.Copy(destVersionPath, versionPath, true);
//            if (File.Exists(versionPath))
//                gameVersion = GameVersion.CreateVersion(File.ReadAllText(versionPath));
//            else
//                gameVersion = GameVersion.CreateVersion(Application.version);
//            // 读取游戏版本号
//            destVersionPath = ABPackHelper.VERSION_PATH + "apk_version.txt";
//            if (File.Exists(destVersionPath))
//            {
//                var ver = File.ReadAllText(destVersionPath);
//                apkVersion = Convert.ToInt32(ver);
//            }
//            else
//                apkVersion = 0;

            if (!File.Exists(DEFAULT_CONFIG_NAME))
            {
                return;
            }
            LoadConfig(DEFAULT_CONFIG_NAME);
            LoadSDKConfig();
            Refresh();
        }
        catch (Exception e)
        {
            Debug.LogException(e);
            save = false;
            AssetBundleEditor.CloseEditor();
        }
    }
Ejemplo n.º 2
0
    public static void BuildIOSProject()
    {
        string path     = string.Empty;
        bool   nobundle = false;
        string key      = string.Empty;

        foreach (string arg in System.Environment.GetCommandLineArgs())
        {
            if (arg.Contains("path:", StringComparison.OrdinalIgnoreCase))
            {
                var splitTmps = arg.Split(';');
                path     = splitTmps[0].Split(':')[1];
                nobundle = splitTmps[1].Split(':')[1].Equals("1");
                key      = splitTmps[2].Split(':')[1];
                break;
            }
        }
        XCodePostProcess.config_path = Application.dataPath + "/Res/Template/IOSConfig/" + path;
        AssetBundleEditor.OpenEditor();
        AssetBundleEditor.Instance.ReleaseIOS(path, nobundle, key);
        AssetBundleEditor.CloseEditor();
    }