Skip to content

Commit f0417ce

Browse files
committed
修复bug
1 parent 80b4254 commit f0417ce

4 files changed

Lines changed: 50 additions & 22 deletions

File tree

Assets/Script/Core/Config/ConfigManager.cs

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,18 @@ public static bool GetIsExistConfig(string ConfigName)
2424
string dataJson = "";
2525

2626
#if UNITY_EDITOR
27-
dataJson = ResourceIOTool.ReadStringByResource(
28-
PathTool.GetRelativelyPath(c_directoryName,
29-
ConfigName,
30-
c_expandName));
27+
if(!Application.isPlaying)
28+
{
29+
dataJson = ResourceIOTool.ReadStringByResource(
30+
PathTool.GetRelativelyPath(c_directoryName,
31+
ConfigName,
32+
c_expandName));
33+
}
34+
else
35+
{
36+
dataJson = ResourceManager.ReadTextFile(ConfigName);
37+
}
38+
3139
#else
3240
dataJson = ResourceManager.ReadTextFile(ConfigName);
3341
#endif
@@ -51,14 +59,21 @@ public static Dictionary<string, SingleField> GetData(string ConfigName)
5159

5260
string dataJson = "";
5361

54-
#if UNITY_EDITOR
55-
dataJson = ResourceIOTool.ReadStringByResource(
56-
PathTool.GetRelativelyPath(c_directoryName,
57-
ConfigName,
58-
c_expandName));
59-
#else
62+
#if UNITY_EDITOR
63+
if (!Application.isPlaying)
64+
{
65+
dataJson = ResourceIOTool.ReadStringByResource(
66+
PathTool.GetRelativelyPath(c_directoryName,
67+
ConfigName,
68+
c_expandName));
69+
}
70+
else
71+
{
72+
dataJson = ResourceManager.ReadTextFile(ConfigName);
73+
}
74+
#else
6075
dataJson = ResourceManager.ReadTextFile(ConfigName);
61-
#endif
76+
#endif
6277

6378
if (dataJson == "")
6479
{

Assets/Script/Core/GameObject/GameObjectManager.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ public static void DestroyGameObjectByPool(GameObject obj, bool isSetActive = tr
155155
s_objectPool.Add(key, new List<GameObject>());
156156
}
157157

158+
if(s_objectPool[key].Contains(obj))
159+
{
160+
throw new Exception("DestroyGameObjectByPool:-> Repeat Destroy GameObject !" + obj);
161+
}
162+
158163
s_objectPool[key].Add(obj);
159164

160165
if(isSetActive)
@@ -369,6 +374,11 @@ public static void DestroyPoolObject(PoolObject obj)
369374
s_objectPool_new.Add(key, new List<PoolObject>());
370375
}
371376

377+
if (s_objectPool_new[key].Contains(obj))
378+
{
379+
throw new Exception("DestroyPoolObject:-> Repeat Destroy GameObject !" + obj);
380+
}
381+
372382
s_objectPool_new[key].Add(obj);
373383

374384
if (obj.SetActive)

Assets/Script/Core/HotUpdate/HotUpdateManager.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
32
using System;
43
using System.Collections;
54
using System.Collections.Generic;
@@ -329,7 +328,7 @@ static float GetHotUpdateProgress(bool isDownLoadVersion,bool isDownLoadMd5,floa
329328

330329
static float GetDownLoadFileProgress(int index)
331330
{
332-
if (s_downLoadList.Count ==0)
331+
if (s_downLoadList.Count == 0)
333332
{
334333
Debug.Log("更新列表为 0");
335334
return 0.95f;
@@ -383,8 +382,6 @@ public static string ReadVersionContent()
383382
dataJson = text.text;
384383
ab.Unload(true);
385384
}
386-
387-
388385
}
389386

390387
return dataJson;

Assets/Script/Core/SDKManager/SDKManager.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,19 +371,25 @@ public static void CloseAD<T>(string SDKName, ADType adType, string tag = "") wh
371371
/// 数据上报
372372
/// </summary>
373373
/// <param name="data"></param>
374-
public static void Log(string eventID,Dictionary<string,object> data)
374+
public static void Log(string eventID, Dictionary<string, object> data)
375375
{
376-
try
376+
if(s_logServiceList == null)
377+
{
378+
throw new Exception("logServiceList is null ,please check SDKManager Init");
379+
}
380+
381+
for (int i = 0; i < s_logServiceList.Count; i++)
377382
{
378-
for (int i = 0; i < s_logServiceList.Count; i++)
383+
try
379384
{
380385
s_logServiceList[i].Log(eventID, data);
381386
}
387+
catch (Exception e)
388+
{
389+
Debug.LogError("SDKManager Log Exception: " + e.ToString());
390+
}
382391
}
383-
catch (Exception e)
384-
{
385-
Debug.LogError("SDKManager Log Exception: " + e.ToString());
386-
}
392+
387393
}
388394
#endregion
389395

0 commit comments

Comments
 (0)