|
@@ -221,6 +221,8 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public Dictionary<string, Dictionary<string, Dictionary<string, GameObject>>> allobjs = new Dictionary<string, Dictionary<string, Dictionary<string, GameObject>>>();
|
|
|
+
|
|
|
public bool isShowDownTip;
|
|
|
private void Start()
|
|
|
{
|
|
@@ -280,15 +282,11 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (downLoadCount != 0)
|
|
|
- {
|
|
|
- Debug.Log("HJJ 判断正在下载downLoadCount != 0");
|
|
|
- UIManager.Instance.HideUI(UINameConfig.LoadingPanel);
|
|
|
- downLoadCount = 0;
|
|
|
- UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.updateEnd);
|
|
|
- isShowDownTip = false;
|
|
|
-
|
|
|
- }
|
|
|
+ Debug.Log("HJJ 判断正在下载downLoadCount != 0");
|
|
|
+ UIManager.Instance.HideUI(UINameConfig.LoadingPanel);
|
|
|
+ downLoadCount = 0;
|
|
|
+ UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.updateEnd);
|
|
|
+ isShowDownTip = false;
|
|
|
}
|
|
|
|
|
|
if(COSDownLoad.showDownLoadCount==0&& downLoadCount ==0)
|
|
@@ -762,7 +760,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
#region 创建水晶点、触发器范围、显示物体
|
|
|
|
|
|
- public void CreateScene(SceneValue scene)
|
|
|
+ public IEnumerator CreateScene(SceneValue scene)
|
|
|
{
|
|
|
SceneValue = scene;
|
|
|
if (m_MinMap.Map.sprite == null)
|
|
@@ -771,9 +769,10 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- StartCreateScene(scene);
|
|
|
+ yield return StartCoroutine(StartCreateScene(scene));
|
|
|
}
|
|
|
- Invoke("MoveScenePatch",1);
|
|
|
+ yield return new WaitForSeconds(1f);
|
|
|
+ MoveScenePatch();
|
|
|
}
|
|
|
private void MoveScenePatch()
|
|
|
{
|
|
@@ -781,7 +780,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
temp.z += MapSize.y;
|
|
|
ObjsParent.parent.localPosition = temp;
|
|
|
}
|
|
|
- private void StartCreateScene(SceneValue scene)
|
|
|
+ private IEnumerator StartCreateScene(SceneValue scene)
|
|
|
{
|
|
|
if (scene.navLines != null && scene.navLines.Count > 0)
|
|
|
SetRouteValue(scene.navLines);
|
|
@@ -789,7 +788,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
Debug.LogError(" 当前场景未设置路径");
|
|
|
Debug.Log("DGJ ====> " + JsonConvert.SerializeObject(scene));
|
|
|
if (scene.listSpoit != null && scene.listSpoit.Count > 0)
|
|
|
- SetSpoitValue(scene.listSpoit);
|
|
|
+ yield return StartCoroutine(SetSpoitValue(scene.listSpoit));
|
|
|
else
|
|
|
Debug.LogError(" 当前场景未创建景点");
|
|
|
|
|
@@ -799,7 +798,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
Debug.LogError(" 当前场景未创建锚点");
|
|
|
|
|
|
|
|
|
-
|
|
|
+ yield return null;
|
|
|
|
|
|
|
|
|
|
|
@@ -877,7 +876,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
|
|
|
|
|
|
- GameManager.Instance.isShowDownTip = true;
|
|
|
+ GameManager.Instance.isShowDownTip = true;
|
|
|
DownloadResManager.Instance.StartDownLoad();
|
|
|
}
|
|
|
|
|
@@ -934,7 +933,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
|
|
|
|
|
|
- public void SetSpoitValue(List<SpoitValue> spoits)
|
|
|
+ public IEnumerator SetSpoitValue(List<SpoitValue> spoits)
|
|
|
{
|
|
|
|
|
|
SpoitValue spoitValue;
|
|
@@ -959,8 +958,8 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
SpoitValue spoit1 = spoit;
|
|
|
|
|
|
CreateCrystalAndTrigger(spoit);
|
|
|
- CreateMaterial(spoit, out spoit1);
|
|
|
- spoits[i] = spoit1;
|
|
|
+ yield return StartCoroutine(CreateMaterial(spoit));
|
|
|
+ spoits[i] = SV;
|
|
|
}
|
|
|
for (int i = 0; i < ListColiderBoxs_Mesh.Count; i++)
|
|
|
{
|
|
@@ -1058,16 +1057,16 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
return spoitObj;
|
|
|
}
|
|
|
-
|
|
|
+ SpoitValue SV;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- private void CreateMaterial(SpoitValue spoit, out SpoitValue newspoit)
|
|
|
+ private IEnumerator CreateMaterial(SpoitValue spoit)
|
|
|
{
|
|
|
if(!ObjectValues.ContainsKey(spoit.id))
|
|
|
{
|
|
|
- newspoit = new SpoitValue();
|
|
|
+ SV = new SpoitValue();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1113,15 +1112,15 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
case (int)MaterialType.Text:
|
|
|
case (int)MaterialType.LocaImage:
|
|
|
Debug.Log("DGJ ===> LocalImage " + material.name);
|
|
|
- objsvalue = CreateSuCaiObj(material, matObj, out newmaterial);
|
|
|
+ objsvalue = CreateSuCaiObj(spoit,material, matObj, out newmaterial);
|
|
|
break;
|
|
|
case (int)MaterialType.Image_Video_Text:
|
|
|
Debug.Log("DGJ ===> Image_Video_Text " + material.name);
|
|
|
- objsvalue = CreateImage_Video_Text(material, matObj, out newmaterial);
|
|
|
+ objsvalue = CreateImage_Video_Text(spoit,material, matObj, out newmaterial);
|
|
|
break;
|
|
|
case (int)MaterialType.Model_Text:
|
|
|
Debug.Log("DGJ ===> Model_Text " + material.name);
|
|
|
- objsvalue = CreateModel_Text(material, matObj, out newmaterial);
|
|
|
+ objsvalue = CreateModel_Text(spoit,material, matObj, out newmaterial);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -1133,7 +1132,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
}
|
|
|
|
|
|
|
|
|
- newspoit = spoit;
|
|
|
+ SV = spoit;
|
|
|
|
|
|
if (ObjectValues.ContainsKey(spoit.id))
|
|
|
{
|
|
@@ -1145,6 +1144,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
}
|
|
|
spoitObj.gameObject.SetActive(false);
|
|
|
}
|
|
|
+ yield return null;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1196,13 +1196,13 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
case (int)MaterialType.Model:
|
|
|
case (int)MaterialType.Text:
|
|
|
case (int)MaterialType.LocaImage:
|
|
|
- objsvalue = CreateSuCaiObj(newmaterial, matObj, out newmaterial);
|
|
|
+ objsvalue = CreateSuCaiObj(spoit, newmaterial, matObj, out newmaterial);
|
|
|
break;
|
|
|
case (int)MaterialType.Image_Video_Text:
|
|
|
- objsvalue = CreateImage_Video_Text(newmaterial, matObj, out newmaterial);
|
|
|
+ objsvalue = CreateImage_Video_Text(spoit,newmaterial, matObj, out newmaterial);
|
|
|
break;
|
|
|
case (int)MaterialType.Model_Text:
|
|
|
- objsvalue = CreateModel_Text(newmaterial, matObj, out newmaterial);
|
|
|
+ objsvalue = CreateModel_Text(spoit, newmaterial, matObj, out newmaterial);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -1235,7 +1235,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
|
|
|
|
|
|
- private List<ObjectValue> CreateSuCaiObj(MaterialObl material, GameObject spoit, out MaterialObl newmaterial)
|
|
|
+ private List<ObjectValue> CreateSuCaiObj(SpoitValue spoitjd, MaterialObl material, GameObject spoit, out MaterialObl newmaterial)
|
|
|
{
|
|
|
List<ObjectValue> objects = new List<ObjectValue>();
|
|
|
List<MaterialObjValue> objs = material.materialList;
|
|
@@ -1298,6 +1298,23 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
if (go != null)
|
|
|
{
|
|
|
+
|
|
|
+ if (!GameManager.Instance.allobjs.ContainsKey(spoitjd.id.ToString()))
|
|
|
+ {
|
|
|
+ GameManager.Instance.allobjs.Add(spoitjd.id.ToString(), new Dictionary<string, Dictionary<string, GameObject>>());
|
|
|
+ }
|
|
|
+ if (!GameManager.Instance.allobjs[spoitjd.id.ToString()].ContainsKey(material.id.ToString()))
|
|
|
+ {
|
|
|
+ GameManager.Instance.allobjs[spoitjd.id.ToString()].Add(material.id.ToString(), new Dictionary<string, GameObject>());
|
|
|
+ }
|
|
|
+ if (!GameManager.Instance.allobjs[spoitjd.id.ToString()][material.id.ToString()].ContainsKey(mat.id.ToString()))
|
|
|
+ {
|
|
|
+ GameManager.Instance.allobjs[spoitjd.id.ToString()][material.id.ToString()].Add(mat.id.ToString(), go);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GameManager.Instance.allobjs[spoitjd.id.ToString()][material.id.ToString()][mat.id.ToString()] = go;
|
|
|
+ }
|
|
|
go.name = string.IsNullOrWhiteSpace(mat.name) ? spoit.name + "-" + i.ToString() : mat.name;
|
|
|
mat.name = go.name;
|
|
|
go.AddComponent<EditorEventHandler>().Type = (MaterialType)(mat.type);
|
|
@@ -1346,7 +1363,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
|
|
|
|
|
|
- private List<ObjectValue> CreateModel_Text(MaterialObl material, GameObject spoit, out MaterialObl newmaterial)
|
|
|
+ private List<ObjectValue> CreateModel_Text(SpoitValue spoitjd, MaterialObl material, GameObject spoit, out MaterialObl newmaterial)
|
|
|
{
|
|
|
List<ObjectValue> objects = new List<ObjectValue>();
|
|
|
List<MaterialObjValue> objs = material.materialList;
|
|
@@ -1379,6 +1396,22 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
if (go != null)
|
|
|
{
|
|
|
+ if (!GameManager.Instance.allobjs.ContainsKey(spoitjd.id.ToString()))
|
|
|
+ {
|
|
|
+ GameManager.Instance.allobjs.Add(spoitjd.id.ToString(), new Dictionary<string, Dictionary<string, GameObject>>());
|
|
|
+ }
|
|
|
+ if (!GameManager.Instance.allobjs[spoitjd.id.ToString()].ContainsKey(material.id.ToString()))
|
|
|
+ {
|
|
|
+ GameManager.Instance.allobjs[spoitjd.id.ToString()].Add(material.id.ToString(), new Dictionary<string, GameObject>());
|
|
|
+ }
|
|
|
+ if (!GameManager.Instance.allobjs[spoitjd.id.ToString()][material.id.ToString()].ContainsKey(mat.id.ToString()))
|
|
|
+ {
|
|
|
+ GameManager.Instance.allobjs[spoitjd.id.ToString()][material.id.ToString()].Add(mat.id.ToString(), go);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GameManager.Instance.allobjs[spoitjd.id.ToString()][material.id.ToString()][mat.id.ToString()] = go;
|
|
|
+ }
|
|
|
go.name = string.IsNullOrWhiteSpace(mat.name) ? spoit.name + "-" + i.ToString() : mat.name;
|
|
|
go.AddComponent<EditorEventHandler>().Type = (MaterialType)(mat.type);
|
|
|
|
|
@@ -1431,65 +1464,13 @@ public class GameManager : MonoSingleton<GameManager>
|
|
|
|
|
|
|
|
|
|
|
|
- private List<ObjectValue> CreateImage_Video_Text(MaterialObl material, GameObject spoit, out MaterialObl newmaterial)
|
|
|
+ private List<ObjectValue> CreateImage_Video_Text(SpoitValue spoitjd,MaterialObl material, GameObject spoit, out MaterialObl newmaterial)
|
|
|
{
|
|
|
Debug.LogError("HJJmaterialObls.select DRFanLayout.CreateImage_Video_Text ");
|
|
|
newmaterial = material;
|
|
|
List<ObjectValue> objects = new List<ObjectValue>();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- switch (material.typesetting)
|
|
|
- {
|
|
|
- case "1":
|
|
|
- SRTitleLayout.CalLayout(material, spoit, out newmaterial);
|
|
|
- break;
|
|
|
- case "2":
|
|
|
- SRTitleLayout.CalLayout(material, spoit, out newmaterial);
|
|
|
- break;
|
|
|
- case "3":
|
|
|
- SRTitleLayout.CalLayout(material, spoit, out newmaterial);
|
|
|
- break;
|
|
|
- case "4":
|
|
|
- SRSectorLayout.CalLayout(material, spoit, out newmaterial);
|
|
|
- break;
|
|
|
- case "5":
|
|
|
- DRTitleLayout.CalLayout(material, spoit, out newmaterial);
|
|
|
- break;
|
|
|
- case "6":
|
|
|
- DRTitleLayout.CalLayout(material, spoit, out newmaterial);
|
|
|
- break;
|
|
|
- case "7":
|
|
|
- DRTitleLayout.CalLayout(material, spoit, out newmaterial);
|
|
|
- break;
|
|
|
- case "8":
|
|
|
- Debug.LogError("HJJmaterialObls.select DRFanLayout.CalLayout ");
|
|
|
- DRFanLayout.CalLayout(material, spoit, out newmaterial);
|
|
|
- break;
|
|
|
+ SRTitleLayout.CalLayout(spoitjd,material, spoit, out newmaterial);
|
|
|
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
Debug.LogError("HJJmaterialObls.select DRFanLayout.CalLayout default ");
|
|
|
|
|
|
return objects;
|