数据同步

This commit is contained in:
高国正 2023-08-15 09:36:07 +08:00
parent cf14eb640c
commit e8b8098372
6 changed files with 15 additions and 3 deletions

Binary file not shown.

View File

@ -69,7 +69,7 @@ public class TransparentGlowManage : MonoBehaviour
ClickEvent clickEvent = item.GetComponent<ClickEvent>(); ClickEvent clickEvent = item.GetComponent<ClickEvent>();
BoxCollider boxCollider = item.GetComponent<BoxCollider>(); BoxCollider boxCollider = item.GetComponent<BoxCollider>();
//CabinetInfor cabinetInfor = item.GetComponent<CabinetInfor>(); //CabinetInfor cabinetInfor = item.GetComponent<CabinetInfor>();
Transform U = item.Find("U位");
if (item.gameObject.activeSelf) if (item.gameObject.activeSelf)
{ {
@ -79,11 +79,11 @@ public class TransparentGlowManage : MonoBehaviour
item.gameObject.AddComponent<ClickEvent>(); item.gameObject.AddComponent<ClickEvent>();
} }
Renderer renderer = null;
if (!boxCollider) if (!boxCollider)
{ {
try try
{ {
Renderer renderer = null;
if (item.childCount != 0) if (item.childCount != 0)
renderer = item.Find(item.name).GetComponent<Renderer>(); renderer = item.Find(item.name).GetComponent<Renderer>();
else else
@ -115,7 +115,7 @@ public class TransparentGlowManage : MonoBehaviour
{ {
Debug.Log(item); Debug.Log(item);
} }
} }
//if (!cabinetInfor) //if (!cabinetInfor)
@ -127,6 +127,18 @@ public class TransparentGlowManage : MonoBehaviour
//{ //{
// cabinetInfor.cabinet.name = item.name; // cabinetInfor.cabinet.name = item.name;
//} //}
if (!U)
{
var go = GameObject.Instantiate(Resources.Load<Transform>("机柜/U位"));
go.name = "U位";
var bounds = renderer.bounds;
Vector3 bottomPosition = bounds.min;
go.position = bottomPosition + new Vector3(0, 0, 0.063f);
go.SetParent(item);
}
} }
} }