From 792a4be031fb0f619fed5e536dd898e17c25ece8 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期六, 11 八月 2018 10:33:37 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
Core/GameEngine/Model/ConfigManager.cs | 20 +++++++++-----------
System/ClientVersion/VersionConfig.cs | 4 ++--
System/AssetVersion/InGameDownTestUtility.cs | 24 +++++++++++++++++++++++-
3 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/Core/GameEngine/Model/ConfigManager.cs b/Core/GameEngine/Model/ConfigManager.cs
index 08d4ec8..716d56b 100644
--- a/Core/GameEngine/Model/ConfigManager.cs
+++ b/Core/GameEngine/Model/ConfigManager.cs
@@ -10,11 +10,8 @@
public class ConfigManager : Singleton<ConfigManager>
{
- public static string CustomIV = "4vHKRj3yfzU=";
- public static string CustomKey = "xhVs6DRXLfUGxw+AhtfQdpQGoa+8SA9d";
-
- protected string[] lineStep = new string[] { "\r\n","\n" }; //琛岄棿闅斾綋
- protected string[] rowStep = new string[] { "\t" }; //娈甸棿闅斾綋
+ public readonly static string CustomIV = "4vHKRj3yfzU=";
+ public readonly static string CustomKey = "xhVs6DRXLfUGxw+AhtfQdpQGoa+8SA9d";
bool isPlaying = true;
@@ -403,7 +400,7 @@
{
if (_task.assetPath == AssetPath.ResourceOut)
{
- lines = File.ReadAllLines(_task.filePath,Encoding.UTF8);
+ lines = File.ReadAllLines(_task.filePath, Encoding.UTF8);
}
else if (_task.assetPath == AssetPath.External)
{
@@ -422,7 +419,8 @@
var crypS = new CryptoStream(tableMs, decryptor, CryptoStreamMode.Read);
sr = new StreamReader(crypS, Encoding.UTF8);
var content = sr.ReadToEnd();
- lines = content.Split(lineStep, StringSplitOptions.None);
+
+ lines = content.Split(new string[] { "\r\n" }, StringSplitOptions.None);
}
_task.state = TaskState.ReadFileSuccess;
@@ -457,7 +455,7 @@
var container = _task.container as Dictionary<string, ConfigBase>;
for (int i = 3; i < _task.contentLines.Length; i++)
{
- var contents = _task.contentLines[i].Split(rowStep, StringSplitOptions.None);
+ var contents = _task.contentLines[i].Split(new string[] { "\t" }, StringSplitOptions.None);
if (contents.Length <= 1)
{
continue;
@@ -537,7 +535,7 @@
case AssetPath.Resource:
path = StringUtility.Contact("Config/", fileName);
var textAsset = Resources.Load<TextAsset>(path);
- lines = textAsset.text.Split(lineStep, StringSplitOptions.None);
+ lines = textAsset.text.Split(new string[] { "\r\n" }, StringSplitOptions.None);
break;
case AssetPath.ResourceOut:
path = StringUtility.Contact(ResourcesPath.CONFIG_FODLER, "/", fileName, ".txt");
@@ -562,7 +560,7 @@
var crypS = new CryptoStream(ms, decryptor, CryptoStreamMode.Read);
var sr = new StreamReader(crypS, Encoding.UTF8);
var content = sr.ReadToEnd();
- lines = content.Split(lineStep, StringSplitOptions.None);
+ lines = content.Split(new string[] { "\r\n" }, StringSplitOptions.None);
break;
}
@@ -591,7 +589,7 @@
{
for (int i = 3; i < _task.contentLines.Length; i++)
{
- var contents = _task.contentLines[i].Split(rowStep, StringSplitOptions.None);
+ var contents = _task.contentLines[i].Split(new string[] { "\t" }, StringSplitOptions.None);
if (contents.Length <= 1)
{
continue;
diff --git a/System/AssetVersion/InGameDownTestUtility.cs b/System/AssetVersion/InGameDownTestUtility.cs
index 0faff17..aa08e8d 100644
--- a/System/AssetVersion/InGameDownTestUtility.cs
+++ b/System/AssetVersion/InGameDownTestUtility.cs
@@ -15,12 +15,34 @@
public static bool isWifi {
get { return LocalSave.GetBool("InGameDownLoadWifi", true); }
set { LocalSave.SetBool("InGameDownLoadWifi", value); }
+ }
+
+ public static bool isPartPackage {
+ get { return LocalSave.GetBool("InGameDownLoadPartPackage", false); }
+ set { LocalSave.SetBool("InGameDownLoadPartPackage", value); }
}
public static void ClearAssets()
{
Directory.Delete(Application.persistentDataPath, true);
LocalSave.DeleteKey("HasDownLoadFullAsset");
- }
+ }
+
+#if UNITY_EDITOR
+ [RuntimeInitializeOnLoadMethod]
+ public static void Init()
+ {
+ if (InGameDownTestUtility.enable)
+ {
+ VersionConfig.Get().assetAccess = InstalledAsset.NullAsset;
+ }
+ else
+ {
+ VersionConfig.Get().assetAccess = InstalledAsset.IngoreDownLoad;
+ }
+
+ VersionConfig.Get().partAssetPackage = InGameDownTestUtility.isPartPackage;
+ }
+#endif
}
diff --git a/System/ClientVersion/VersionConfig.cs b/System/ClientVersion/VersionConfig.cs
index 8222657..f834b92 100644
--- a/System/ClientVersion/VersionConfig.cs
+++ b/System/ClientVersion/VersionConfig.cs
@@ -28,10 +28,10 @@
public int branch { get { return m_Branch; } }
[SerializeField] InstalledAsset m_AssetAccess = InstalledAsset.IngoreDownLoad;
- public InstalledAsset assetAccess { get { return m_AssetAccess; } }
+ public InstalledAsset assetAccess { get { return m_AssetAccess; } set { m_AssetAccess = value; } }
[SerializeField] bool m_PartAssetPackage = false;
- public bool partAssetPackage { get { return m_PartAssetPackage; } }
+ public bool partAssetPackage { get { return m_PartAssetPackage; } set { m_PartAssetPackage = value; } }
[SerializeField] string m_ProductName = string.Empty;
public string productName { get { return m_ProductName; } }
--
Gitblit v1.8.0