少年修仙传客户端基础资源
lwb
2021-02-25 f57f62816a6f621cb7e7946e7a97ef5c6f570a82
Assets/Editor/Tool/ClientPackage.cs
@@ -61,6 +61,7 @@
    /// <param name="_replace">ios打包导出xcode工程模式,Append和Replace</param>
    public static void BuildPublishers(string _sdkPath, string _assetBundlePath, string _output, string _publisherString, int _buildIndex, bool _development, bool _replace)
    {
        var publisherIds = new List<string>();
        var tempStrings = _publisherString.Split(StringUtility.splitSeparator, StringSplitOptions.RemoveEmptyEntries);
@@ -263,7 +264,7 @@
                    }
                }
            }
            //剔除表资源
            if (!includeConfig)
            {
@@ -548,60 +549,47 @@
    private static void PreBuild(string _publisher, int _buildIndex)
    {
        try
        var newVersionConfigPath = StringUtility.Contact("Assets/Resources/VersionConfig", ".asset");
        var versionName = string.Empty;
        var fromVersionConfig = GetVersionConfig(_publisher, out versionName);
        var newVersionConfig = ScriptableObject.CreateInstance<VersionConfig>();
        if (File.Exists(newVersionConfigPath))
        {
            var newVersionConfigPath = StringUtility.Contact("Assets/Resources/VersionConfig", ".asset");
            var versionName = string.Empty;
            var fromVersionConfig = GetVersionConfig(_publisher, out versionName);
            var newVersionConfig = ScriptableObject.CreateInstance<VersionConfig>();
            if (File.Exists(newVersionConfigPath))
            {
                AssetDatabase.DeleteAsset(newVersionConfigPath);
            }
            VersionConfig.Copy(fromVersionConfig, newVersionConfig);
            newVersionConfig.buildTime = DateTime.Now.ToString("yy/MM/dd--HH:mm");
            newVersionConfig.buildIndex = _buildIndex;
            if (File.Exists(Application.dataPath + "/Resources/Game.txt"))
            {
                File.Delete(Application.dataPath + "/Resources/Game.txt");
            }
            File.WriteAllText(Application.dataPath + "/Resources/Game.txt", GetGameId(_publisher));
            AssetDatabase.CreateAsset(newVersionConfig, newVersionConfigPath);
            EditorUtility.SetDirty(newVersionConfig);
            SetIconAndSplashImage(versionName);
            //SetCreateRoleAnimation();
            PlayerSettings.companyName = "TheSecondWorld";
            PlayerSettings.productName = newVersionConfig.productName;
            PlayerSettings.applicationIdentifier = newVersionConfig.bundleIdentifier;
            PlayerSettings.defaultInterfaceOrientation = UIOrientation.AutoRotation;
            PlayerSettings.allowedAutorotateToLandscapeLeft = true;
            PlayerSettings.allowedAutorotateToLandscapeRight = true;
            PlayerSettings.allowedAutorotateToPortrait = false;
            PlayerSettings.allowedAutorotateToPortraitUpsideDown = false;
            PlayerSettings.bundleVersion = VersionConfig.GetVersionNumber(newVersionConfig.version).ToString();
            if (GetBuildTarget() == BuildTargetGroup.Android)
            {
                CSObjectWrapEditor.Generator.ClearAll();
                CSObjectWrapEditor.Generator.GenAll();
            }
        }
        catch (Exception ex)
        {
            Debug.Log(ex);
        }
        finally
        {
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
            AssetDatabase.DeleteAsset(newVersionConfigPath);
        }
        VersionConfig.Copy(fromVersionConfig, newVersionConfig);
        newVersionConfig.buildTime = DateTime.Now.ToString("yy/MM/dd--HH:mm");
        newVersionConfig.buildIndex = _buildIndex;
        if (File.Exists(Application.dataPath + "/Resources/Game.txt"))
        {
            File.Delete(Application.dataPath + "/Resources/Game.txt");
        }
        File.WriteAllText(Application.dataPath + "/Resources/Game.txt", GetGameId(_publisher));
        AssetDatabase.CreateAsset(newVersionConfig, newVersionConfigPath);
        EditorUtility.SetDirty(newVersionConfig);
        SetIconAndSplashImage(versionName);
        //SetCreateRoleAnimation();
        PlayerSettings.companyName = "TheSecondWorld";
        PlayerSettings.productName = newVersionConfig.productName;
        PlayerSettings.applicationIdentifier = newVersionConfig.bundleIdentifier;
        PlayerSettings.defaultInterfaceOrientation = UIOrientation.AutoRotation;
        PlayerSettings.allowedAutorotateToLandscapeLeft = true;
        PlayerSettings.allowedAutorotateToLandscapeRight = true;
        PlayerSettings.allowedAutorotateToPortrait = false;
        PlayerSettings.allowedAutorotateToPortraitUpsideDown = false;
        PlayerSettings.bundleVersion = VersionConfig.GetVersionNumber(newVersionConfig.version).ToString();
        //生成ILruntiemd CLR 绑定代码
        ILRuntimeCLRBinding.GenerateCLRBinding();
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
    }
    static VersionConfig GetVersionConfig(string _publisher, out string _versionName)