Merge remote-tracking branch 'origin/dev_memory' into dev_cyp
This commit is contained in:
commit
e3e2f5200b
7 files changed
+31
-9
No files matched your search
@@ -53,6 +53,17 @@ namespace Assets.Scripts.Scenes
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
var objAry = Resources.FindObjectsOfTypeAll<Material>();
|
||||
|
||||
for (int i = 0; i < objAry.Length; ++i)
|
||||
{
|
||||
objAry[i] = null;//解除资源的引用
|
||||
}
|
||||
var objAry2 = Resources.FindObjectsOfTypeAll<Texture>();
|
||||
for (int i = 0; i < objAry2.Length; ++i)
|
||||
{
|
||||
objAry2[i] = null;//解除资源的引用
|
||||
}
|
||||
Resources.UnloadUnusedAssets();
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
public RouteResultParam selectParamModel;
|
||||
public RouteResult routeResult;
|
||||
|
||||
public GameObject minicamera;
|
||||
|
||||
public Dictionary<int, SeletedPlayerScript> selectPlayerDic { set; get; } = new Dictionary<int, SeletedPlayerScript>();
|
||||
|
||||
public int preticks;
|
||||
@@ -195,7 +197,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
watcher = Resources.Load<GameObject>("UI/Prefab/Match/Watcher");
|
||||
target = transform.Find("Target");
|
||||
miniMap = transform.Find("MiniMap").gameObject;//小地图
|
||||
|
||||
minicamera = transform.Find("MiniCamera").gameObject;
|
||||
//进入倒计时
|
||||
singleUIManager = UIObject.GetComponent<BaseUIManager>();
|
||||
TrailRenderer trail = player.GetComponent<TrailRenderer>();
|
||||
@@ -377,17 +379,23 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//加载人物和地图以及UI界面
|
||||
private void InitGameObject()
|
||||
{
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
minicamera.SetActive(true);
|
||||
miniMap.SetActive(true);
|
||||
#endif
|
||||
map.gameObject.SetActive(true);
|
||||
player.SetActive(true);
|
||||
UIObject.SetActive(true);
|
||||
singleUIManager = UIObject.AddComponent<SingleUIManager>();
|
||||
miniMap.SetActive(true);
|
||||
map.OnTileFinished += Map_OnTileFinished;
|
||||
mapPos = map.transform.position;
|
||||
}
|
||||
|
||||
private void InitRaceGameObject()
|
||||
{
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
minicamera.SetActive(true);
|
||||
#endif
|
||||
map.gameObject.SetActive(true);
|
||||
player.SetActive(true);
|
||||
UIObject.SetActive(true);
|
||||
|
||||
@@ -142,7 +142,7 @@ public class DeviceView : MonoBehaviour
|
||||
}));
|
||||
|
||||
UIManager.AddEvent(connectionButton.gameObject, EventTriggerType.PointerClick, new UnityEngine.Events.UnityAction<BaseEventData>(e => {
|
||||
if (!mPairButton.activeSelf)
|
||||
if (!connectionPanel.activeSelf)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1072,6 +1072,8 @@ public class UIManager : MonoBehaviour
|
||||
private void OnDestroy()
|
||||
{
|
||||
UIManager.Instance = null;
|
||||
Resources.UnloadUnusedAssets();
|
||||
GC.Collect();
|
||||
}
|
||||
public static void SwitchAccount()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user