|
|
|
@ -220,43 +220,46 @@ public class ObjSelectCtrl : MonoBehaviour
|
|
|
|
|
{ |
|
|
|
|
if (info.buildNum == data.CurrentFloor.buildNum) |
|
|
|
|
{ |
|
|
|
|
if (info.floorNum > data.CurrentFloor.floorNum || |
|
|
|
|
(info.floorNum == data.CurrentFloor.floorNum && info.interlayerNum > data.CurrentFloor.interlayerNum)) |
|
|
|
|
if (data.CurrentFloor.floorNum!=0) |
|
|
|
|
{ |
|
|
|
|
Renderer[] renderers = SelectedObjs.selectedObj.GetComponentsInChildren<Renderer>(); |
|
|
|
|
for (int i = 0; i < renderers.Length; i++) |
|
|
|
|
{ |
|
|
|
|
renderers[i].enabled = false; |
|
|
|
|
} |
|
|
|
|
if (SelectedObjs.selectedObj.GetComponent<CreatHaemalUI>()) //如果是被困人员/伤员,绑定了UI |
|
|
|
|
if (info.floorNum > data.CurrentFloor.floorNum || |
|
|
|
|
(info.floorNum == data.CurrentFloor.floorNum && info.interlayerNum > data.CurrentFloor.interlayerNum)) |
|
|
|
|
{ |
|
|
|
|
Transform ui = SelectedObjs.selectedObj.GetComponent<CreatHaemalUI>().haemal.transform; |
|
|
|
|
Image[] images = ui.GetComponentsInChildren<Image>(true); |
|
|
|
|
for (int j = 0; j < images.Length; j++) |
|
|
|
|
Renderer[] renderers = SelectedObjs.selectedObj.GetComponentsInChildren<Renderer>(); |
|
|
|
|
for (int i = 0; i < renderers.Length; i++) |
|
|
|
|
{ |
|
|
|
|
images[j].enabled = false; |
|
|
|
|
renderers[i].enabled = false; |
|
|
|
|
} |
|
|
|
|
Text[] texts = ui.GetComponentsInChildren<Text>(true); |
|
|
|
|
for (int j = 0; j < texts.Length; j++) |
|
|
|
|
if (SelectedObjs.selectedObj.GetComponent<CreatHaemalUI>()) //如果是被困人员/伤员,绑定了UI |
|
|
|
|
{ |
|
|
|
|
texts[j].enabled = false; |
|
|
|
|
Transform ui = SelectedObjs.selectedObj.GetComponent<CreatHaemalUI>().haemal.transform; |
|
|
|
|
Image[] images = ui.GetComponentsInChildren<Image>(true); |
|
|
|
|
for (int j = 0; j < images.Length; j++) |
|
|
|
|
{ |
|
|
|
|
images[j].enabled = false; |
|
|
|
|
} |
|
|
|
|
Text[] texts = ui.GetComponentsInChildren<Text>(true); |
|
|
|
|
for (int j = 0; j < texts.Length; j++) |
|
|
|
|
{ |
|
|
|
|
texts[j].enabled = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.fireman || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<TruckMessage>()|| |
|
|
|
|
|
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.Trailer || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.OilSupplyTruck || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.LiquipSupplyTruck || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.RescueCarrierCar || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.LifeGuaranteeCar) |
|
|
|
|
{ |
|
|
|
|
UINameItem[] names = GameObject.Find("Canvas").transform.Find("TheHeadName").GetComponentsInChildren<UINameItem>(true); |
|
|
|
|
for (int j = 0; j < names.Length; j++) |
|
|
|
|
if (SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.fireman || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<TruckMessage>() || |
|
|
|
|
|
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.Trailer || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.OilSupplyTruck || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.LiquipSupplyTruck || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.RescueCarrierCar || |
|
|
|
|
SelectedObjs.selectedObj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.LifeGuaranteeCar) |
|
|
|
|
{ |
|
|
|
|
if (names[j].Target == SelectedObjs.selectedObj.gameObject) |
|
|
|
|
UINameItem[] names = GameObject.Find("Canvas").transform.Find("TheHeadName").GetComponentsInChildren<UINameItem>(true); |
|
|
|
|
for (int j = 0; j < names.Length; j++) |
|
|
|
|
{ |
|
|
|
|
names[j].gameObject.SetActive(false); |
|
|
|
|
if (names[j].Target == SelectedObjs.selectedObj.gameObject) |
|
|
|
|
{ |
|
|
|
|
names[j].gameObject.SetActive(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -276,22 +279,26 @@ public class ObjSelectCtrl : MonoBehaviour
|
|
|
|
|
{ |
|
|
|
|
if (info.buildNum == data.CurrentFloor.buildNum) |
|
|
|
|
{ |
|
|
|
|
if (info.floorNum > data.CurrentFloor.floorNum || |
|
|
|
|
(info.floorNum == data.CurrentFloor.floorNum && info.interlayerNum > data.CurrentFloor.interlayerNum)) |
|
|
|
|
if (data.CurrentFloor.floorNum!=0) |
|
|
|
|
{ |
|
|
|
|
Renderer[] renderers = SelectedObjs.selectedCharacters[i].GetComponentsInChildren<Renderer>(); |
|
|
|
|
for (int j = 0; j < renderers.Length; j++) |
|
|
|
|
if (info.floorNum > data.CurrentFloor.floorNum || |
|
|
|
|
(info.floorNum == data.CurrentFloor.floorNum && info.interlayerNum > data.CurrentFloor.interlayerNum)) |
|
|
|
|
{ |
|
|
|
|
renderers[j].enabled = false; |
|
|
|
|
} |
|
|
|
|
for (int j = 0; j < names.Length; j++) |
|
|
|
|
{ |
|
|
|
|
if (names[j].Target == SelectedObjs.selectedCharacters[i]) |
|
|
|
|
Renderer[] renderers = SelectedObjs.selectedCharacters[i].GetComponentsInChildren<Renderer>(); |
|
|
|
|
for (int j = 0; j < renderers.Length; j++) |
|
|
|
|
{ |
|
|
|
|
renderers[j].enabled = false; |
|
|
|
|
} |
|
|
|
|
for (int j = 0; j < names.Length; j++) |
|
|
|
|
{ |
|
|
|
|
names[j].gameObject.SetActive(false); |
|
|
|
|
if (names[j].Target == SelectedObjs.selectedCharacters[i]) |
|
|
|
|
{ |
|
|
|
|
names[j].gameObject.SetActive(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|