This commit is contained in:
YangHua 2023-08-29 12:56:18 +08:00
commit ddb9745cbb
12 changed files with 10781 additions and 40 deletions

File diff suppressed because it is too large Load Diff

View File

@ -140,15 +140,15 @@ public class CameraRT : MonoBehaviour
//x = cam.transform.localEulerAngles.y;
//y = cam.transform.localEulerAngles.x;
Array.ForEach(GameObject.FindObjectsOfType<ClickEvent>(), itme =>
Array.ForEach(GameObject.FindObjectsOfType<ClickEvent>(true), itme =>
{
itme.My_magnifyState = false;
if (itme.GetComponent<DeviceQuery>())
{
if (itme.GetComponent<DeviceQuery>().deviceList.type == "1")
itme.gameObject.SetActive(true);
}
});
//Array.ForEach(GameObject.FindObjectsOfType<TransparentGlow>(), itme =>
//{
// itme.F2();
//});
PatternChoose.Inst.transform.Find("设备类/设备配置").gameObject.SetActive(false);
PatternChoose.Inst.transform.Find("设备类/设备新增").gameObject.SetActive(false);
PatternChoose.Inst.transform.Find("端口类/端口配置").gameObject.SetActive(false);
@ -173,10 +173,14 @@ public class CameraRT : MonoBehaviour
public void InitBirds_Eye()
{
auto_move = true;
Array.ForEach(GameObject.FindObjectsOfType<ClickEvent>(), itme =>
{
itme.My_magnifyState = false;
if (itme.GetComponent<DeviceQuery>())
{
if (itme.GetComponent<DeviceQuery>().deviceList.type == "1")
itme.gameObject.SetActive(true);
}
});
PatternChoose.Inst.transform.Find("设备类/设备配置").gameObject.SetActive(false);
PatternChoose.Inst.transform.Find("设备类/设备新增").gameObject.SetActive(false);
@ -227,6 +231,8 @@ public class CameraRT : MonoBehaviour
Vector3 oldMousePos;
void Update()
{
if (mask_img.activeSelf) return;
else if (!GameManager.Inst.isLoading) return;
BoolMonitor.Value = ismove();
if (auto_move)
@ -296,6 +302,8 @@ public class CameraRT : MonoBehaviour
private Transform cameraTransform;
private Vector3 lastPosition;
private Quaternion lastRotation;
public GameObject mask_img;
//检测相机是否移动
public bool ismove()
{

View File

@ -174,7 +174,7 @@ public class SearchName : MonoBehaviour
break;
case SearchType.ÏßÀ¹ʾ:
{
scrollViewContent.GetChild(i).GetComponent<Button>().onClick.AddListener(() =>
scrollViewContent.GetChild(co).GetComponent<Button>().onClick.AddListener(() =>
{
TransparentGlowManage.Inst.transparencyALL(GameObject.Find("»ú¹ñ").GetComponentsInChildren<TransparentGlow>());
@ -183,27 +183,40 @@ public class SearchName : MonoBehaviour
var A = GameManager.Inst.FindParent(objs[i].gameObject, GameManager.Inst.IsDesiredParent);
//var B = GameManager.Inst.FindParent(lines[1].gameObject, GameManager.Inst.IsDesiredParent);
var B_ = Array.Find(GameManager.Inst.TmsPorts_go.ToArray(), (item) =>
{
try
{
return (item.GetComponent<PortQuery>().portList.conPort == objs[i].GetComponent<PortQuery>().portList.port &&
item.GetComponent<PortQuery>().portList.remark == objs[i].GetComponent<PortQuery>().portList.remark);
}
catch
{
return false;
//var A = GameManager.Inst.FindParent(objs[co].gameObject, GameManager.Inst.IsDesiredParent);
////var B = GameManager.Inst.FindParent(lines[1].gameObject, GameManager.Inst.IsDesiredParent);
//var B_ = Array.Find(GameManager.Inst.TmsPorts_go.ToArray(), (item) =>
// {
// try
// {
// return (item.GetComponent<PortQuery>().portList.conPort == objs[co].GetComponent<PortQuery>().portList.port &&
// item.GetComponent<PortQuery>().portList.remark == objs[co].GetComponent<PortQuery>().portList.remark);
// }
// catch
// {
// return false;
}
});
var B = GameManager.Inst.FindParent(B_, GameManager.Inst.IsDesiredParent);
// }
// });
//var B = GameManager.Inst.FindParent(B_, GameManager.Inst.IsDesiredParent);
//List<TransparentGlow> transparentGlows = new List<TransparentGlow>();
//transparentGlows.Add(A.GetComponent<TransparentGlow>());
//transparentGlows.Add(B.GetComponent<TransparentGlow>());
List<TransparentGlow> transparentGlows = new List<TransparentGlow>();
transparentGlows.Add(A.GetComponent<TransparentGlow>());
transparentGlows.Add(B.GetComponent<TransparentGlow>());
Array.ForEach(GameObject.Find("ÏßÀÂ").GetComponentsInChildren<LineInfor>(), (item) =>
{
if (item.name != objs_str[co])
return;
GameObject go1= GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
GameObject go2 = GameManager.Inst.FindParent( item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
transparentGlows.Add(go1.GetComponent<TransparentGlow>());
transparentGlows.Add(go2.GetComponent<TransparentGlow>());
});
TransparentGlowManage.Inst.renewALL(transparentGlows.ToArray());
@ -281,6 +294,8 @@ public class SearchName : MonoBehaviour
init();
Dictionary<string, string> dic = new Dictionary<string, string>();
CreateLine createLine = PatternChoose.Inst.transform.Find("»­Ïß").GetComponent<CreateLine>();
for (int i = 0; i < createLine.list7.Count; i++)
@ -288,7 +303,10 @@ public class SearchName : MonoBehaviour
if (i != 0 && i % 2 != 0)
{
objs.Add(createLine.list7[i].gameObject);
string s = createLine.list7[i].GetComponent<PortQuery>().portList.remark;
string s = createLine.list7[i].GetComponent<PortQuery>().portList.cableGroupName;
if (dic.ContainsKey(s))
continue;
dic.Add(s, "");
objs_str.Add(s);
SearchObjects.Add(s);
}

View File

@ -137,7 +137,7 @@ public class AddDevice : MonoBehaviour
{
yield return StartCoroutine(saveJson());
if (URlreturn.message == "操作成功")
if (URlreturn != null && URlreturn.message == "操作成功")
{
yield return StartCoroutine(Succeed());

View File

@ -143,7 +143,7 @@ public class AddPort : MonoBehaviour
{
yield return StartCoroutine(saveJson());
if (URlreturn.message == "操作成功")
if (URlreturn != null && URlreturn.message == "操作成功")
{
yield return StartCoroutine(Succeed());

View File

@ -18,7 +18,7 @@ public class DeleteDevice : MonoBehaviour
{
yield return StartCoroutine(saveJson());
if (URlreturn.message == "操作成功")
if (URlreturn != null && URlreturn.message == "操作成功")
{
yield return StartCoroutine(Succeed());

View File

@ -17,7 +17,7 @@ public class DeletePort : MonoBehaviour
{
yield return StartCoroutine(saveJson());
if (URlreturn.message == "操作成功")
if (URlreturn != null && URlreturn.message == "操作成功")
{
yield return StartCoroutine(Succeed());

View File

@ -95,7 +95,7 @@ public class RedactDevice : MonoBehaviour
private IEnumerator SaveJsonCoroutine()
{
yield return StartCoroutine(saveJson());
if (URlreturn.message == "操作成功")
if (URlreturn != null && URlreturn.message == "操作成功")
{
yield return StartCoroutine(Succeed());

View File

@ -178,7 +178,7 @@ public class RedactPort : MonoBehaviour
private IEnumerator SaveJsonCoroutine()
{
yield return StartCoroutine(saveJson());
if (URlreturn.message == "操作成功")
if (URlreturn != null && URlreturn.message == "操作成功")
{
yield return StartCoroutine(Succeed());

View File

@ -54,7 +54,7 @@ public class LineQuery : MonoBehaviour
{
Root root = new Root();
yield return StartCoroutine(getJson(root, (x) => { root = x; }));
if (root.message == "操作成功")
if (root != null && root.message == "操作成功")
{
if (root.data != null && root.data.Count > 0)
{
@ -89,7 +89,7 @@ public class LineQuery : MonoBehaviour
{
Root root = new Root();
yield return StartCoroutine(deleteJson(root, id, (x) => { root = x; }));
if (root.message == "操作成功")
if (root != null && root.message == "操作成功")
{
foreach (var item in keyValues.Keys)
{
@ -118,7 +118,7 @@ public class LineQuery : MonoBehaviour
{
Root root = new Root();
yield return StartCoroutine(saveJson(root, lineContentJson, (x) => { root = x; }));
if (root.message == "操作成功")
if (root != null && root.message == "操作成功")
{
yield return StartCoroutine(getJsonCoroutine());
}

View File

@ -486,7 +486,8 @@ public class ClickEvent : MonoBehaviour
/// </summary>
public void Zoomin(GameObject cabine)
{
ExtendedFlycam.Inst.init_mainCamera_rot();
ExtendedFlycam.Inst.CameraRtDisable();
//ExtendedFlycam.Inst.init_mainCamera_rot();
// 物体被点击
Debug.Log("放大点击到" + gameObject.name);
GameManager.Inst.nowDevice = gameObject;
@ -534,18 +535,19 @@ public class ClickEvent : MonoBehaviour
/// <param name="hit"></param>
public void Zoomout(GameObject cabine)
{
ExtendedFlycam.Inst.CameraRtDisable();
GameManager.Inst.nowDeviceID = null;
My_magnifyState = false;
GameManager.Inst.magnifyState = false;
TransparentGlowManage.Inst.is_magnify = false;
ExtendedFlycam.Inst.init_mainCamera_rot();
//ExtendedFlycam.Inst.init_mainCamera_rot();
// 物体被点击
Debug.Log("缩小点击到" + gameObject.name);
Camera.main.transform.DOMove(TransparentGlowManage.Inst.MainCamera_pos, 1f);
Camera.main.transform.DORotateQuaternion(Quaternion.Euler(TransparentGlowManage.Inst.MainCamera_rot), 1f).OnComplete(() =>
{
//更新相机初始旋转角度
ExtendedFlycam.Inst.initialRotationEulerAngles = Camera.main.transform.localEulerAngles;
//ExtendedFlycam.Inst.initialRotationEulerAngles = Camera.main.transform.localEulerAngles;
if (cabine&& cabine.transform.Find("门把手").GetComponentInChildren<Door>())
{
var door = cabine.transform.Find("门把手").GetComponentInChildren<Door>();

View File

@ -153,7 +153,7 @@ public class CreateLine : CabinetUIBase
lineRenderer.SetPositions(vector3s.ToArray());
go.transform.SetParent(xianLan);
go.name = A.GetComponent<PortQuery>().portList.remark;
go.name = A.GetComponent<PortQuery>().portList.cableGroupName;
go.SetActive(false);
var l = go.AddComponent<LineInfor>();
l.lines.Add(A);
@ -221,7 +221,7 @@ public class CreateLine : CabinetUIBase
lineRenderer.SetPositions(vector3s.ToArray());
go.transform.SetParent(xianLan);
go.name = A.GetComponent<PortQuery>().portList.remark;
go.name = A.GetComponent<PortQuery>().portList.cableGroupName;
go.SetActive(false);
var l = go.AddComponent<LineInfor>();
l.lines.Add(A);