|
|
|
@ -87,7 +87,12 @@ public class UIFloor : BaseToggle
|
|
|
|
|
{ |
|
|
|
|
foreach (var item in floorsPanelManager.AllNei) |
|
|
|
|
{ |
|
|
|
|
item.gameObject.SetActive(true); |
|
|
|
|
Renderer[] renderers = item.GetComponentsInChildren<Renderer>(); |
|
|
|
|
for (int i = 0; i < renderers.Length; i++) |
|
|
|
|
{ |
|
|
|
|
renderers[i].enabled = true; |
|
|
|
|
} |
|
|
|
|
//item.gameObject.SetActive(true); |
|
|
|
|
} |
|
|
|
|
foreach (var item in floorsPanelManager.AllWai) |
|
|
|
|
{ |
|
|
|
@ -112,11 +117,21 @@ public class UIFloor : BaseToggle
|
|
|
|
|
{ |
|
|
|
|
if (item.buildNum == data.buildNum && item.floorNum > data.floorNum && Mathf.Abs(item.floorNum) > 0) |
|
|
|
|
{ |
|
|
|
|
item.gameObject.SetActive(false); |
|
|
|
|
Renderer[] renderers = item.GetComponentsInChildren<Renderer>(); |
|
|
|
|
for (int i = 0; i < renderers.Length; i++) |
|
|
|
|
{ |
|
|
|
|
renderers[i].enabled = false; |
|
|
|
|
} |
|
|
|
|
// item.gameObject.SetActive(false); |
|
|
|
|
} |
|
|
|
|
if (item.buildNum == data.buildNum && item.floorNum == data.floorNum && item.interlayerNum > data.interlayerNum && Mathf.Abs(item.floorNum) > 0) |
|
|
|
|
{ |
|
|
|
|
item.gameObject.SetActive(false); |
|
|
|
|
Renderer[] renderers = item.GetComponentsInChildren<Renderer>(); |
|
|
|
|
for (int i = 0; i < renderers.Length; i++) |
|
|
|
|
{ |
|
|
|
|
renderers[i].enabled = false; |
|
|
|
|
} |
|
|
|
|
//item.gameObject.SetActive(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -134,26 +149,27 @@ public class UIFloor : BaseToggle
|
|
|
|
|
private void ShowCloneObj() |
|
|
|
|
{ |
|
|
|
|
CloneGameObjInfo[] objs = P_AllParent.GetComponentsInChildren<CloneGameObjInfo>(true); |
|
|
|
|
UINameItem[] names = GameObject.Find("Canvas").transform.Find("TheHeadName").GetComponentsInChildren<UINameItem>(true); |
|
|
|
|
for (int i = 0; i < objs.Length; i++) |
|
|
|
|
{ |
|
|
|
|
//objs[i].gameObject.SetActive(true); |
|
|
|
|
MeshRenderer[] renders = objs[i].GetComponentsInChildren<MeshRenderer>(); |
|
|
|
|
Renderer[] renders = objs[i].GetComponentsInChildren<Renderer>(); |
|
|
|
|
//objs[i].gameObject.SetActive(false); |
|
|
|
|
for (int j = 0; j < renders.Length; j++) |
|
|
|
|
{ |
|
|
|
|
renders[j].enabled = true; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
ParticleSystem[] parts = objs[i].GetComponentsInChildren<ParticleSystem>(); |
|
|
|
|
for (int j = 0; j < parts.Length; j++) |
|
|
|
|
{ |
|
|
|
|
parts[j].Play(); |
|
|
|
|
} |
|
|
|
|
SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren<SkinnedMeshRenderer>(); |
|
|
|
|
for (int j = 0; j < skmeshs.Length; j++) |
|
|
|
|
{ |
|
|
|
|
skmeshs[j].enabled=true; |
|
|
|
|
} |
|
|
|
|
//ParticleSystem[] parts = objs[i].GetComponentsInChildren<ParticleSystem>(); |
|
|
|
|
//for (int j = 0; j < parts.Length; j++) |
|
|
|
|
//{ |
|
|
|
|
// parts[j].Play(); |
|
|
|
|
//} |
|
|
|
|
//SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren<SkinnedMeshRenderer>(); |
|
|
|
|
//for (int j = 0; j < skmeshs.Length; j++) |
|
|
|
|
//{ |
|
|
|
|
// skmeshs[j].enabled=true; |
|
|
|
|
//} |
|
|
|
|
if (objs[i].GetComponent<CreatHaemalUI>()) //如果是被困人员/伤员,绑定了UI |
|
|
|
|
{ |
|
|
|
|
Transform ui = objs[i].GetComponent<CreatHaemalUI>().haemal.transform; |
|
|
|
@ -169,11 +185,23 @@ public class UIFloor : BaseToggle
|
|
|
|
|
texts[j].enabled = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (objs[i].GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.fireman || |
|
|
|
|
objs[i].GetComponent<TruckMessage>()) |
|
|
|
|
{ |
|
|
|
|
for (int j = 0; j < names.Length; j++) |
|
|
|
|
{ |
|
|
|
|
if (names[j].Target == objs[i].gameObject) |
|
|
|
|
{ |
|
|
|
|
names[j].gameObject.SetActive(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private void HideCloneObj(FloorData data) |
|
|
|
|
{ |
|
|
|
|
CloneGameObjInfo[] objs = P_AllParent.GetComponentsInChildren<CloneGameObjInfo>(); |
|
|
|
|
UINameItem[] names = GameObject.Find("Canvas").transform.Find("TheHeadName").GetComponentsInChildren<UINameItem>(true); |
|
|
|
|
for (int i = 0; i < objs.Length; i++) |
|
|
|
|
{ |
|
|
|
|
if (objs[i].gameObject == SelectedObjs.selectedObj || SelectedObjs.selectedCharacters.Contains( objs[i].gameObject)) |
|
|
|
@ -200,23 +228,24 @@ public class UIFloor : BaseToggle
|
|
|
|
|
if (objs[i].floorNum > data.floorNum || |
|
|
|
|
(objs[i].floorNum == data.floorNum && objs[i].interlayerNum > data.interlayerNum)) |
|
|
|
|
{ |
|
|
|
|
MeshRenderer[] renders = objs[i].GetComponentsInChildren<MeshRenderer>(); |
|
|
|
|
Renderer[] renders = objs[i].GetComponentsInChildren<Renderer>(); |
|
|
|
|
//objs[i].gameObject.SetActive(false); |
|
|
|
|
for (int j = 0; j < renders.Length; j++) |
|
|
|
|
{ |
|
|
|
|
renders[j].enabled = false; |
|
|
|
|
} |
|
|
|
|
ParticleSystem[] parts = objs[i].GetComponentsInChildren<ParticleSystem>(); |
|
|
|
|
//objs[i].gameObject.SetActive(false); |
|
|
|
|
for (int j = 0; j < parts.Length; j++) |
|
|
|
|
{ |
|
|
|
|
parts[j].Stop(); |
|
|
|
|
} |
|
|
|
|
SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren<SkinnedMeshRenderer>(); |
|
|
|
|
for (int j = 0; j < skmeshs.Length; j++) |
|
|
|
|
{ |
|
|
|
|
skmeshs[j].enabled = false; |
|
|
|
|
} |
|
|
|
|
//ParticleSystem[] parts = objs[i].GetComponentsInChildren<ParticleSystem>(); |
|
|
|
|
////objs[i].gameObject.SetActive(false); |
|
|
|
|
//for (int j = 0; j < parts.Length; j++) |
|
|
|
|
//{ |
|
|
|
|
// // parts[j].Stop(); |
|
|
|
|
// parts[j].GetComponent<Renderer>().enabled = false; |
|
|
|
|
//} |
|
|
|
|
//SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren<SkinnedMeshRenderer>(); |
|
|
|
|
//for (int j = 0; j < skmeshs.Length; j++) |
|
|
|
|
//{ |
|
|
|
|
// skmeshs[j].enabled = false; |
|
|
|
|
//} |
|
|
|
|
if (objs[i].GetComponent<CreatHaemalUI>()) //如果是被困人员/伤员,绑定了UI |
|
|
|
|
{ |
|
|
|
|
Transform ui = objs[i].GetComponent<CreatHaemalUI>().haemal.transform; |
|
|
|
@ -231,10 +260,22 @@ public class UIFloor : BaseToggle
|
|
|
|
|
texts[j].enabled = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (objs[i].GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.fireman || |
|
|
|
|
objs[i].GetComponent<TruckMessage>()) |
|
|
|
|
{ |
|
|
|
|
for (int j = 0; j < names.Length; j++) |
|
|
|
|
{ |
|
|
|
|
if (names[j].Target == objs[i].gameObject) |
|
|
|
|
{ |
|
|
|
|
names[j].gameObject.SetActive(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//private void AddRecordUIFloor(FloorData data) |
|
|
|
|