| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System.IO; |
| | | |
| | | #if UNITY_EDITOR |
| | | using UnityEditor; |
| | | #endif |
| | | |
| | | [CreateAssetMenu(menuName = "Config/VersionConfig")] |
| | | public class VersionConfig : ScriptableObject
|
| | | { |
| | | public const string VERSION_ALTERNATIVE = "1.0.15";
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using System.IO;
|
| | |
|
| | | [SerializeField] public string m_AppId = string.Empty; |
| | | #if UNITY_EDITOR
|
| | | using UnityEditor;
|
| | | #endif
|
| | |
|
| | | [CreateAssetMenu(menuName = "Config/VersionConfig")]
|
| | | public class VersionConfig : ScriptableObject
|
| | | {
|
| | | public const string VERSION_ALTERNATIVE = "0.0.0";
|
| | |
|
| | | [SerializeField] public string m_AppId = string.Empty;
|
| | | public string appId { get { return m_AppId; } }
|
| | |
|
| | | [SerializeField] VersionAuthority m_VersionAuthority; |
| | | public VersionAuthority versionAuthority { get { return m_VersionAuthority; } } |
| | | |
| | | [SerializeField] public string m_Version; |
| | | [SerializeField] VersionAuthority m_VersionAuthority;
|
| | | public VersionAuthority versionAuthority { get { return m_VersionAuthority; } }
|
| | |
|
| | | [SerializeField] public string m_Version;
|
| | | public string version { get { return VersionCompare(m_Version, VERSION_ALTERNATIVE); } }
|
| | |
|
| | | [SerializeField] string m_ClientPackageFlag;
|
| | | public string clientPackageFlag { get { return m_ClientPackageFlag; } } |
| | | |
| | | [SerializeField] int m_Branch = 0; |
| | | public string clientPackageFlag { get { return m_ClientPackageFlag; } }
|
| | |
|
| | | [SerializeField] int m_Branch = 0;
|
| | | public int branch {
|
| | | get {
|
| | | if (DebugUtility.Instance.debugAccount && DebugUtility.Instance.debugBranch >= 0)
|
| | |
| | | return m_Branch;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | [SerializeField] InstalledAsset m_AssetAccess = InstalledAsset.IngoreDownLoad;
|
| | | public InstalledAsset assetAccess { get { return m_AssetAccess; } set { m_AssetAccess = value; } } |
| | | |
| | | public InstalledAsset assetAccess { get { return m_AssetAccess; } set { m_AssetAccess = value; } }
|
| | |
|
| | | [SerializeField] bool m_PartAssetPackage = false;
|
| | | public bool partAssetPackage { get { return m_PartAssetPackage; } set { m_PartAssetPackage = value; } } |
| | | |
| | | [SerializeField] string m_ProductName = string.Empty; |
| | | public string productName { get { return m_ProductName; } } |
| | | |
| | | [SerializeField] string m_BundleIdentifier = string.Empty; |
| | | public string bundleIdentifier { get { return m_BundleIdentifier; } } |
| | | |
| | | [SerializeField] string m_KeystoreFileName; |
| | | public bool partAssetPackage { get { return m_PartAssetPackage; } set { m_PartAssetPackage = value; } }
|
| | |
|
| | | [SerializeField] string m_ProductName = string.Empty;
|
| | | public string productName { get { return m_ProductName; } }
|
| | |
|
| | | [SerializeField] string m_BundleIdentifier = string.Empty;
|
| | | public string bundleIdentifier { get { return m_BundleIdentifier; } }
|
| | |
|
| | | [SerializeField] string m_KeystoreFileName;
|
| | | public string keystoreFileName { get { return m_KeystoreFileName; } }
|
| | |
|
| | | [SerializeField] string m_KeystorePassword; |
| | | public string keystorePassword { get { return m_KeystorePassword; } } |
| | | |
| | | [SerializeField] string m_KeystoreAlias; |
| | | [SerializeField] string m_KeystorePassword;
|
| | | public string keystorePassword { get { return m_KeystorePassword; } }
|
| | |
|
| | | [SerializeField] string m_KeystoreAlias;
|
| | | public string keystoreAlias { get { return m_KeystoreAlias; } }
|
| | |
|
| | | [SerializeField] string m_KeystoreAliasPassword; |
| | | public string keystoreAliasPassword { get { return m_KeystoreAliasPassword; } } |
| | | |
| | | [SerializeField] string m_KeystoreAliasPassword;
|
| | | public string keystoreAliasPassword { get { return m_KeystoreAliasPassword; } }
|
| | |
|
| | | [SerializeField] string m_AppleDeveloperTeamID;
|
| | | public string appleDeveloperTeamID { get { return m_AppleDeveloperTeamID; } }
|
| | |
|
| | | [SerializeField] bool m_DebugVersion = false; |
| | | [SerializeField] bool m_DebugVersion = false;
|
| | | public bool debugVersion {
|
| | | get { return m_DebugVersion; }
|
| | | set { m_DebugVersion = value; }
|
| | | }
|
| | |
|
| | | [SerializeField] bool m_IsBanShu = false; |
| | | [SerializeField] bool m_IsBanShu = false;
|
| | | public bool isBanShu {
|
| | | get { return m_IsBanShu; }
|
| | | set { m_IsBanShu = value; }
|
| | | } |
| | | |
| | | [SerializeField] string m_BuildTime; |
| | | }
|
| | |
|
| | | [SerializeField] string m_BuildTime;
|
| | | public string buildTime {
|
| | | get { return m_BuildTime; }
|
| | | set { m_BuildTime = value; }
|
| | | }
|
| | |
|
| | | [SerializeField] int m_BuildIndex; |
| | | [SerializeField] int m_BuildIndex;
|
| | | public int buildIndex {
|
| | | get { return m_BuildIndex; }
|
| | | set { m_BuildIndex = value; }
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | [SerializeField] Vector2 m_LogoPosition;
|
| | | public Vector2 logoPosition { get { return m_LogoPosition; } }
|
| | |
|
| | |
| | | m_LogoPosition = dataStrings[18].Vector3Parse();
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR |
| | | [ContextMenu("Apply")] |
| | | #if UNITY_EDITOR
|
| | | [ContextMenu("Apply")]
|
| | | public void Apply()
|
| | | {
|
| | | var newVersionConfigPath = StringUtility.Contact("Assets/Resources/ScriptableObject/Config/VersionConfig", ".asset");
|
| | |
| | | AssetDatabase.CreateAsset(newVersionConfig, newVersionConfigPath);
|
| | | EditorUtility.SetDirty(newVersionConfig);
|
| | | AssetDatabase.SaveAssets();
|
| | | } |
| | | #endif |
| | | |
| | | static VersionConfig config = null; |
| | | }
|
| | | #endif
|
| | |
|
| | | static VersionConfig config = null;
|
| | | public static VersionConfig Get()
|
| | | {
|
| | | if (config == null)
|
| | |
| | | }
|
| | |
|
| | | return config;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | public static void Copy(VersionConfig _from, VersionConfig _to)
|
| | | {
|
| | | _to.m_VersionAuthority = _from.m_VersionAuthority;
|
| | |
| | | _to.m_IsBanShu = _from.m_IsBanShu;
|
| | | _to.m_ClientPackageFlag = _from.m_ClientPackageFlag;
|
| | | _to.m_LogoPosition = _from.m_LogoPosition;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 比较两个版本,返回更大的那个
|
| | | /// </summary>
|
| | | /// <param name="_lhs"></param>
|
| | | /// <param name="_rhs"></param>
|
| | | /// <returns></returns> |
| | | /// <returns></returns>
|
| | | static string VersionCompare(string _lhs, string _rhs)
|
| | | {
|
| | | var lhsStrings = _lhs.Split('.');
|
| | |
| | | return version1 > version2 ? _lhs : _rhs;
|
| | |
|
| | | }
|
| | | } |
| | | |
| | | } |
| | | }
|
| | |
|
| | | }
|