|
@@ -20,6 +20,10 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
#region
|
|
|
|
|
|
+ public static bool CopyComplete
|
|
|
+ {
|
|
|
+ get { return CopyCount == 0; }
|
|
|
+ }
|
|
|
public static bool UpdateComplete;
|
|
|
public static AssetBundle NewDressConfig;
|
|
|
public static AssetBundle NewDressSke;
|
|
@@ -30,6 +34,24 @@ public class Bundle : MonoBehaviour
|
|
|
public static List<XmlAttributeCollection> NewDressroomConfigs = new List<XmlAttributeCollection>();
|
|
|
public static List<XmlAttributeCollection> NewFlowerConfigs = new List<XmlAttributeCollection>();
|
|
|
|
|
|
+ public static List<string> HotUpdateAssetBundleNames=new List<string>
|
|
|
+ {
|
|
|
+ ResourceLabel.NewDressConfig,
|
|
|
+ ResourceLabel.NewDressSke,
|
|
|
+ ResourceLabel.NewDressTex,
|
|
|
+ ResourceLabel.NewLanguage,
|
|
|
+ ResourceLabel.NewFlowerConfig,
|
|
|
+ ResourceLabel.NewFlowerTex,
|
|
|
+ };
|
|
|
+
|
|
|
+ public List<Object> NewDressConfigList;
|
|
|
+ public List<Object> NewDressSkeList;
|
|
|
+ public List<Object> NewDressTexList;
|
|
|
+ public List<Object> NewDressTexConfigList;
|
|
|
+ public List<Object> NewDressSpriteList;
|
|
|
+ public List<Object> NewLanguageList;
|
|
|
+ public List<Object> NewFlowerConfigList;
|
|
|
+ public List<Object> NewFlowerSpriteList;
|
|
|
|
|
|
public static Bundle Instance;
|
|
|
|
|
@@ -57,14 +79,12 @@ public class Bundle : MonoBehaviour
|
|
|
public List<Object> ConfigList;
|
|
|
public List<Object> DiscardList;
|
|
|
public List<Object> PlazaRoomList;
|
|
|
- public List<Object> DressList;
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- public void Awake()
|
|
|
+ public void Begin()
|
|
|
{
|
|
|
Instance = this;
|
|
|
-
|
|
|
LoadAll
|
|
|
(
|
|
|
() => Complete = true
|
|
@@ -76,7 +96,7 @@ public class Bundle : MonoBehaviour
|
|
|
if (Initializer.Instance.DebugMode)
|
|
|
{
|
|
|
#region MyRegion
|
|
|
-
|
|
|
+
|
|
|
if (folder == Folder.UI)
|
|
|
{
|
|
|
for (int i = 0; i < Instance.UiList.Count; i++)
|
|
@@ -121,7 +141,7 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
if (goName == "Expression")
|
|
|
{
|
|
|
- return (T)(Object)Sprite.Create(Instance.ExpressionTexture, new Rect(0, 0, Instance.AtlasTexture.width, Instance.AtlasTexture.height), new Vector2(0.5f, 0.5f));
|
|
|
+ return (T) (Object) Sprite.Create(Instance.ExpressionTexture, new Rect(0, 0, Instance.AtlasTexture.width, Instance.AtlasTexture.height), new Vector2(0.5f, 0.5f));
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < Instance.SceneList.Count; i++)
|
|
@@ -138,7 +158,7 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
if (Instance.DiscardList[i].name == goName)
|
|
|
{
|
|
|
- return (T)Instance.DiscardList[i];
|
|
|
+ return (T) Instance.DiscardList[i];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -153,7 +173,7 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
if (Instance.AtlasList[i].name == goName)
|
|
|
{
|
|
|
- return (T)Instance.AtlasList[i];
|
|
|
+ return (T) Instance.AtlasList[i];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -163,7 +183,7 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
if (Instance.PlazaRoomList[i].name == goName)
|
|
|
{
|
|
|
- return (T)Instance.PlazaRoomList[i];
|
|
|
+ return (T) Instance.PlazaRoomList[i];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -284,7 +304,7 @@ public class Bundle : MonoBehaviour
|
|
|
|
|
|
for (int i = 0; i < objects.Length; i++)
|
|
|
{
|
|
|
- Sprite sprite = (Sprite)objects[i];
|
|
|
+ Sprite sprite = (Sprite) objects[i];
|
|
|
|
|
|
PlayerManager.CloseSpriteDictionary.Add(sprite.name, sprite);
|
|
|
ResourceManager.SpriteDictionary.UniqueAdd(sprite.name, sprite);
|
|
@@ -382,7 +402,7 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
if (Application.isEditor)
|
|
|
// return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/"); // Use the build output folder directly.
|
|
|
- return "file://" + Application.streamingAssetsPath + "/Bundle/Windows/";//user local stream
|
|
|
+ return "file://" + Application.streamingAssetsPath + "/Bundle/Windows/"; //user local stream
|
|
|
|
|
|
else if (Application.isWebPlayer)
|
|
|
return System.IO.Path.GetDirectoryName(Application.absoluteURL).Replace("\\", "/") + "/StreamingAssets";
|
|
@@ -399,10 +419,20 @@ public class Bundle : MonoBehaviour
|
|
|
//return "file://" + Application.streamingAssetsPath + "/Bundle/Windows/";
|
|
|
}
|
|
|
|
|
|
+ public static string GetStreamingUrlPath()
|
|
|
+ {
|
|
|
+ if (Application.platform == RuntimePlatform.IPhonePlayer)
|
|
|
+ return "file://" + Application.streamingAssetsPath;
|
|
|
+ else if (Application.isMobilePlatform)
|
|
|
+ return Application.streamingAssetsPath;
|
|
|
+ else
|
|
|
+ return "file://" + Application.streamingAssetsPath;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public void LoadAll(UnityAction callback)
|
|
|
{
|
|
|
- StartCoroutine(ILoadAll(callback));
|
|
|
+ Initializer.Instance.StartCoroutine(ILoadAll(callback));
|
|
|
}
|
|
|
|
|
|
public static IEnumerator ILoadAll(UnityAction callback)
|
|
@@ -411,7 +441,11 @@ public class Bundle : MonoBehaviour
|
|
|
|
|
|
if (!Logo.Complete && !Initializer.Instance.DebugMode)
|
|
|
{
|
|
|
- ResourceManager.AddAsyncLoad<TextAsset>(ResourceLabel.PlayerConfig, Folder.Config, () => { ConfigManager.ConfigDocument = ConfigManager.ConfigDocument; HttpManager.GetBuyPackLimitFlag(); });
|
|
|
+ ResourceManager.AddAsyncLoad<TextAsset>(ResourceLabel.PlayerConfig, Folder.Config, () =>
|
|
|
+ {
|
|
|
+ ConfigManager.ConfigDocument = ConfigManager.ConfigDocument;
|
|
|
+ HttpManager.GetBuyPackLimitFlag();
|
|
|
+ });
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -652,95 +686,199 @@ public class Bundle : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static void UpdateAssetBundle()
|
|
|
+ private static int CopyCount = 0;
|
|
|
+ public static void CopyAssetBundles()
|
|
|
{
|
|
|
- string persistentFolder = $"{Application.persistentDataPath}{Path.DirectorySeparatorChar}HotUpdate";
|
|
|
- string streamingFolder = $"{Application.streamingAssetsPath}{Path.DirectorySeparatorChar}Bundle{Path.DirectorySeparatorChar}Windows{Path.DirectorySeparatorChar}HotUpdate";
|
|
|
- List<AssetBundleSet> assetBundleSets = AssetBundleUtility.GetAssetBundleSetsFromFolders
|
|
|
- (
|
|
|
- persistentFolder,
|
|
|
- streamingFolder
|
|
|
- );
|
|
|
- string localMD5 = AssetBundleUtility.GetMD5OfAssetBundleSets(assetBundleSets);
|
|
|
- string serverMD5 = "AE29F7EE00843A792D96CA02D6907FAA";
|
|
|
- //bool needUpdate = localMD5 != serverMD5;
|
|
|
- bool needUpdate = false;
|
|
|
- Debug.LogWarning($"NeedUpdate : {needUpdate}");
|
|
|
- if (needUpdate)
|
|
|
- {
|
|
|
- AssetBundleUtility.UpdateAllAssetBundle
|
|
|
- (
|
|
|
- "new_dress_config|F1F0FA4EB0C70A658BB03E935738C422|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_dress_config\r\nnew_dress_ske|531AE05FA301BBAD7B58B532BCD04CFD|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_dress_ske\r\nnew_dress_tex|3060DC78E5C9A8D58CF440C6C66035C4|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_dress_tex\r\nnew_flower_config|0CD417F29E1C7580A742BFC33DAE7DF5|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_flower_config\r\nnew_flower_tex|8640D886CB7D71B5D5EBA8D0FF037573|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_flower_tex\r\nnew_language_config|D7683A0A8867FBC6D32CFF5C9F41BAC4|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_language_config",
|
|
|
- persistentFolder,
|
|
|
- assetBundleSets,
|
|
|
- DownloadAllAssetBundleSucceed,
|
|
|
- DownloadAllAssetBundleFailed,
|
|
|
- DownloadAssetBundleSucceed,
|
|
|
- DownloadAssetBundleFailed
|
|
|
- );
|
|
|
+ string persistentFolderPath = $"{Application.persistentDataPath}{Path.DirectorySeparatorChar}HotUpdate";
|
|
|
+ if (!Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(persistentFolderPath);
|
|
|
+ }
|
|
|
+ string streamingFolder;
|
|
|
+ if (Application.platform == RuntimePlatform.IPhonePlayer)
|
|
|
+ {
|
|
|
+ streamingFolder = "IOS";
|
|
|
+ }
|
|
|
+ else if (Application.platform == RuntimePlatform.Android)
|
|
|
+ {
|
|
|
+ streamingFolder = "Android";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- AssetBundleUtility.LoadAllAssetBundle
|
|
|
- (
|
|
|
- assetBundleSets,
|
|
|
- DownloadAllAssetBundleSucceed,
|
|
|
- DownloadAllAssetBundleFailed,
|
|
|
- DownloadAssetBundleSucceed,
|
|
|
- DownloadAssetBundleFailed
|
|
|
- );
|
|
|
+ streamingFolder = "Windows";
|
|
|
+ }
|
|
|
+ foreach (var assetBundleName in HotUpdateAssetBundleNames)
|
|
|
+ {
|
|
|
+ if (!File.Exists(persistentFolderPath + Path.DirectorySeparatorChar + assetBundleName))
|
|
|
+ {
|
|
|
+ CopyCount++;
|
|
|
+ Initializer.Instance.StartCoroutine
|
|
|
+ (
|
|
|
+ LoadAssetBundle
|
|
|
+ (
|
|
|
+ streamingFolder,
|
|
|
+ assetBundleName,
|
|
|
+ www =>
|
|
|
+ {
|
|
|
+ File.WriteAllBytes(persistentFolderPath + Path.DirectorySeparatorChar + assetBundleName, www.bytes);
|
|
|
+ CopyOneAssetBundleFinish();
|
|
|
+ }
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void DownloadAllAssetBundleSucceed()
|
|
|
+ private static void CopyOneAssetBundleFinish()
|
|
|
{
|
|
|
- NewDressroomConfigs = ConfigManager.GetDressRoomConfig(NewDressConfig.LoadAsset<TextAsset>(ResourceLabel.NewDressroomConfig));
|
|
|
+ CopyCount--;
|
|
|
+ }
|
|
|
|
|
|
- TextAsset[] textAssets = NewDressSke.LoadAllAssets<TextAsset>();
|
|
|
- foreach (var textAsset in textAssets)
|
|
|
+ public static IEnumerator LoadAssetBundle(string folder, string name, Action<WWW> callback)
|
|
|
+ {
|
|
|
+ WWW www = new WWW(GetStreamingUrlPath() + Path.DirectorySeparatorChar + "Bundle" + Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar + "HotUpdate" + Path.DirectorySeparatorChar + name);
|
|
|
+ yield return www;
|
|
|
+ if (string.IsNullOrEmpty(www.error))
|
|
|
{
|
|
|
- UnityFactory.factory.LoadDragonBonesData(textAsset);
|
|
|
+ callback.Invoke(www);
|
|
|
}
|
|
|
-
|
|
|
- textAssets = NewDressTex.LoadAllAssets<TextAsset>();
|
|
|
- Texture2D[] textures = NewDressTex.LoadAllAssets<Texture2D>();
|
|
|
- for (int i = 0; i < textAssets.Length; i++)
|
|
|
+ else
|
|
|
{
|
|
|
- ResourceManager.ObjectDictionary.Add(textures[i].name, textures[i]);
|
|
|
- UnityFactory.factory.LoadTextureAtlasData(textAssets[i], textures[i].name);
|
|
|
+ Debug.Log(www.error);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- Sprite[] sprites = NewDressTex.LoadAllAssets<Sprite>();
|
|
|
- for (int i = 0; i < sprites.Length; i++)
|
|
|
+ public static bool UpdateAssetBundles()
|
|
|
+ {
|
|
|
+ try
|
|
|
{
|
|
|
- PlayerManager.CloseSpriteDictionary.Add(sprites[i].name, sprites[i]);
|
|
|
- ResourceManager.ObjectDictionary.UniqueAdd(sprites[i].name, sprites[i]);
|
|
|
+ Initializer.DebugText.text = "U0";
|
|
|
+ if (Initializer.Instance.DebugMode)
|
|
|
+ {
|
|
|
+ SkipUpdateForDebugMode();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ Initializer.DebugText.text = "U1";
|
|
|
+ string persistentFolderPath = $"{Application.persistentDataPath}{Path.DirectorySeparatorChar}HotUpdate";
|
|
|
+
|
|
|
+ Initializer.DebugText.text = "U2";
|
|
|
+ List<AssetBundleSet> assetBundleSets = AssetBundleUtility.GetAssetBundleSetsFromFolders
|
|
|
+ (
|
|
|
+ persistentFolderPath
|
|
|
+ );
|
|
|
+ Initializer.DebugText.text = "U3";
|
|
|
+ string localMD5 = AssetBundleUtility.GetMD5OfAssetBundleSets(assetBundleSets);
|
|
|
+ string serverMD5 = "AE29F7EE00843A792D96CA02D6907FAA";
|
|
|
+ bool needUpdate = localMD5 != serverMD5;
|
|
|
+ if (Application.isEditor)
|
|
|
+ {
|
|
|
+ needUpdate = false;
|
|
|
+ }
|
|
|
+ needUpdate = false;
|
|
|
+ //Debug.LogWarning($"NeedUpdate : {needUpdate}");
|
|
|
+
|
|
|
+ if (needUpdate)
|
|
|
+ {
|
|
|
+ Initializer.DebugText.text = "U4";
|
|
|
+ AssetBundleUtility.UpdateAllAssetBundle
|
|
|
+ (
|
|
|
+ "new_dress_config|F1F0FA4EB0C70A658BB03E935738C422|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_dress_config\r\nnew_dress_ske|531AE05FA301BBAD7B58B532BCD04CFD|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_dress_ske\r\nnew_dress_tex|3060DC78E5C9A8D58CF440C6C66035C4|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_dress_tex\r\nnew_flower_config|0CD417F29E1C7580A742BFC33DAE7DF5|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_flower_config\r\nnew_flower_tex|8640D886CB7D71B5D5EBA8D0FF037573|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_flower_tex\r\nnew_language_config|D7683A0A8867FBC6D32CFF5C9F41BAC4|file://E:\\UnityProject\\Garden5\\Assets\\HotUpdateTest\\new_language_config",
|
|
|
+ persistentFolderPath,
|
|
|
+ assetBundleSets,
|
|
|
+ DownloadAllAssetBundleSucceed,
|
|
|
+ DownloadAllAssetBundleFailed,
|
|
|
+ DownloadAssetBundleSucceed,
|
|
|
+ DownloadAssetBundleFailed
|
|
|
+ );
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Initializer.DebugText.text = "U5";
|
|
|
+ AssetBundleUtility.LoadAllAssetBundle
|
|
|
+ (
|
|
|
+ assetBundleSets,
|
|
|
+ DownloadAllAssetBundleSucceed,
|
|
|
+ DownloadAllAssetBundleFailed,
|
|
|
+ DownloadAssetBundleSucceed,
|
|
|
+ DownloadAssetBundleFailed
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ Initializer.EnableDebugLab();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- TextAsset language = NewLanguage.LoadAsset<TextAsset>(ResourceLabel.NewEnglish);
|
|
|
- XmlDocument document = new XmlDocument();
|
|
|
- document.LoadXml(language.text);
|
|
|
- Language.AddLanguageDocument(CurrentLanguage.English, document);
|
|
|
+ public static void DownloadAllAssetBundleSucceed()
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Initializer.DebugText.text = "01";
|
|
|
+ NewDressroomConfigs = ConfigManager.GetDressRoomConfig(NewDressConfig.LoadAsset<TextAsset>(ResourceLabel.NewDressroomConfig));
|
|
|
|
|
|
- language = NewLanguage.LoadAsset<TextAsset>(ResourceLabel.NewChineseSimplified);
|
|
|
- document = new XmlDocument();
|
|
|
- document.LoadXml(language.text);
|
|
|
- Language.AddLanguageDocument(CurrentLanguage.ChineseSimplified, document);
|
|
|
+ Initializer.DebugText.text = "02";
|
|
|
+ TextAsset[] textAssets = NewDressSke.LoadAllAssets<TextAsset>();
|
|
|
+ foreach (var textAsset in textAssets)
|
|
|
+ {
|
|
|
+ UnityFactory.factory.LoadDragonBonesData(textAsset);
|
|
|
+ }
|
|
|
|
|
|
- language = NewLanguage.LoadAsset<TextAsset>(ResourceLabel.NewChineseTraditional);
|
|
|
- document = new XmlDocument();
|
|
|
- document.LoadXml(language.text);
|
|
|
- Language.AddLanguageDocument(CurrentLanguage.ChineseTraditional, document);
|
|
|
+ Initializer.DebugText.text = "03";
|
|
|
+ textAssets = NewDressTex.LoadAllAssets<TextAsset>();
|
|
|
+ Texture2D[] textures = NewDressTex.LoadAllAssets<Texture2D>();
|
|
|
+ for (int i = 0; i < textAssets.Length; i++)
|
|
|
+ {
|
|
|
+ ResourceManager.ObjectDictionary.Add(textures[i].name, textures[i]);
|
|
|
+ UnityFactory.factory.LoadTextureAtlasData(textAssets[i], textures[i].name);
|
|
|
+ }
|
|
|
|
|
|
- NewFlowerConfigs = ConfigManager.GetFlowerConfig(NewFlowerConfig.LoadAsset<TextAsset>(ResourceLabel.NewFlowerConfig));
|
|
|
+ Initializer.DebugText.text = "04";
|
|
|
+ Sprite[] sprites = NewDressTex.LoadAllAssets<Sprite>();
|
|
|
+ for (int i = 0; i < sprites.Length; i++)
|
|
|
+ {
|
|
|
+ PlayerManager.CloseSpriteDictionary.Add(sprites[i].name, sprites[i]);
|
|
|
+ ResourceManager.ObjectDictionary.UniqueAdd(sprites[i].name, sprites[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ Initializer.DebugText.text = "05";
|
|
|
+ TextAsset language = NewLanguage.LoadAsset<TextAsset>(ResourceLabel.NewEnglish);
|
|
|
+ XmlDocument document = new XmlDocument();
|
|
|
+ document.LoadXml(language.text);
|
|
|
+ Language.AddLanguageDocument(CurrentLanguage.English, document);
|
|
|
+
|
|
|
+ Initializer.DebugText.text = "06";
|
|
|
+ language = NewLanguage.LoadAsset<TextAsset>(ResourceLabel.NewChineseSimplified);
|
|
|
+ document = new XmlDocument();
|
|
|
+ document.LoadXml(language.text);
|
|
|
+ Language.AddLanguageDocument(CurrentLanguage.ChineseSimplified, document);
|
|
|
+
|
|
|
+ Initializer.DebugText.text = "07";
|
|
|
+ language = NewLanguage.LoadAsset<TextAsset>(ResourceLabel.NewChineseTraditional);
|
|
|
+ document = new XmlDocument();
|
|
|
+ document.LoadXml(language.text);
|
|
|
+ Language.AddLanguageDocument(CurrentLanguage.ChineseTraditional, document);
|
|
|
+
|
|
|
+ Initializer.DebugText.text = "08";
|
|
|
+ NewFlowerConfigs = ConfigManager.GetFlowerConfig(NewFlowerConfig.LoadAsset<TextAsset>(ResourceLabel.NewFlowerConfig));
|
|
|
+
|
|
|
+ Initializer.DebugText.text = "09";
|
|
|
+ sprites = NewFlowerTex.LoadAllAssets<Sprite>();
|
|
|
+ for (int i = 0; i < sprites.Length; i++)
|
|
|
+ {
|
|
|
+ ResourceManager.ObjectDictionary.UniqueAdd(sprites[i].name, sprites[i]);
|
|
|
+ }
|
|
|
|
|
|
- sprites = NewFlowerTex.LoadAllAssets<Sprite>();
|
|
|
- for (int i = 0; i < sprites.Length; i++)
|
|
|
+ UpdateComplete = true;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
{
|
|
|
- ResourceManager.ObjectDictionary.UniqueAdd(sprites[i].name, sprites[i]);
|
|
|
+ Initializer.DebugText.text += e.ToString();
|
|
|
+ Initializer.EnableDebugLab();
|
|
|
}
|
|
|
-
|
|
|
- UpdateComplete = true;
|
|
|
}
|
|
|
|
|
|
public static void DownloadAllAssetBundleFailed()
|
|
@@ -778,6 +916,66 @@ public class Bundle : MonoBehaviour
|
|
|
|
|
|
public static void DownloadAssetBundleFailed(AssetBundleSet assetBundleSet, string error)
|
|
|
{
|
|
|
- Debug.Log(error);
|
|
|
+ Initializer.DebugText.text = assetBundleSet.Name;
|
|
|
+ Initializer.DebugText.text += error;
|
|
|
+ Initializer.EnableDebugLab();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SkipUpdateForDebugMode()
|
|
|
+ {
|
|
|
+ NewDressroomConfigs = ConfigManager.GetDressRoomConfig(Instance.NewDressConfigList[0] as TextAsset);
|
|
|
+
|
|
|
+ foreach (var textAsset in Instance.NewDressSkeList)
|
|
|
+ {
|
|
|
+ UnityFactory.factory.LoadDragonBonesData(textAsset as TextAsset);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < Instance.NewDressTexList.Count; i++)
|
|
|
+ {
|
|
|
+ TextAsset textAsset = Instance.NewDressTexConfigList[i] as TextAsset;
|
|
|
+ Texture2D texture = Instance.NewDressTexList[i] as Texture2D;
|
|
|
+ ResourceManager.ObjectDictionary.Add(texture.name, texture);
|
|
|
+ UnityFactory.factory.LoadTextureAtlasData(textAsset, texture.name);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < Instance.NewDressSpriteList.Count; i++)
|
|
|
+ {
|
|
|
+ Sprite sprite = Instance.NewDressSpriteList[i] as Sprite;
|
|
|
+ PlayerManager.CloseSpriteDictionary.Add(sprite.name, sprite);
|
|
|
+ ResourceManager.ObjectDictionary.UniqueAdd(sprite.name, sprite);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < Instance.NewLanguageList.Count; i++)
|
|
|
+ {
|
|
|
+ TextAsset textAsset = Instance.NewLanguageList[i] as TextAsset;
|
|
|
+ if (textAsset.name == ResourceLabel.NewEnglish)
|
|
|
+ {
|
|
|
+ XmlDocument document = new XmlDocument();
|
|
|
+ document.LoadXml(textAsset.text);
|
|
|
+ Language.AddLanguageDocument(CurrentLanguage.English, document);
|
|
|
+ }
|
|
|
+ else if (textAsset.name == ResourceLabel.NewChineseSimplified)
|
|
|
+ {
|
|
|
+ XmlDocument document = new XmlDocument();
|
|
|
+ document.LoadXml(textAsset.text);
|
|
|
+ Language.AddLanguageDocument(CurrentLanguage.English, document);
|
|
|
+ }
|
|
|
+ else if (textAsset.name == ResourceLabel.NewChineseTraditional)
|
|
|
+ {
|
|
|
+ XmlDocument document = new XmlDocument();
|
|
|
+ document.LoadXml(textAsset.text);
|
|
|
+ Language.AddLanguageDocument(CurrentLanguage.English, document);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ NewDressroomConfigs = ConfigManager.GetDressRoomConfig(Instance.NewFlowerConfigList[0] as TextAsset);
|
|
|
+
|
|
|
+ foreach (var obj in Instance.NewFlowerSpriteList)
|
|
|
+ {
|
|
|
+ Sprite sprite = obj as Sprite;
|
|
|
+ ResourceManager.ObjectDictionary.UniqueAdd(sprite.name, sprite);
|
|
|
+ }
|
|
|
+
|
|
|
+ UpdateComplete = true;
|
|
|
}
|
|
|
}
|