fix:代码提交
This commit is contained in:
@@ -39,6 +39,10 @@ public class AppCache
|
||||
public static List<IconData> iconPointList04;
|
||||
//相机点位加速度震动监测
|
||||
public static List<Transform> iconCameraList04 = new List<Transform>();
|
||||
|
||||
public static List<IconData> iconPointList05;
|
||||
//相机点位加速度震动监测
|
||||
public static List<Transform> iconCameraList05 = new List<Transform>();
|
||||
public static List<Vector3> areaPointList01 = new List<Vector3>();
|
||||
public static List<Vector3> areaPointList02 = new List<Vector3>();
|
||||
|
||||
|
||||
@@ -188,24 +188,24 @@ public class CameraControl : MonoBehaviour
|
||||
}
|
||||
|
||||
//开启相机控制
|
||||
public void StartCameraControl()
|
||||
{
|
||||
isCameraCtrl = true;
|
||||
isClickUI = false;
|
||||
viewPos_0 = mainCamera.ScreenToViewportPoint(Input.mousePosition);
|
||||
viewPos_1 = mainCamera.ScreenToViewportPoint(Input.mousePosition);
|
||||
startCameraPos = transform.position;
|
||||
startCameraEuler = transform.eulerAngles;
|
||||
targetCameraPos = transform.position;
|
||||
// public void StartCameraControl()
|
||||
// {
|
||||
// isCameraCtrl = true;
|
||||
// isClickUI = false;
|
||||
// viewPos_0 = mainCamera.ScreenToViewportPoint(Input.mousePosition);
|
||||
// viewPos_1 = mainCamera.ScreenToViewportPoint(Input.mousePosition);
|
||||
// startCameraPos = transform.position;
|
||||
// startCameraEuler = transform.eulerAngles;
|
||||
// targetCameraPos = transform.position;
|
||||
|
||||
targetCameraEuler = transform.eulerAngles;
|
||||
}
|
||||
// targetCameraEuler = transform.eulerAngles;
|
||||
// }
|
||||
|
||||
//停止相机控制
|
||||
public void StopCameraControl()
|
||||
{
|
||||
isCameraCtrl = false;
|
||||
}
|
||||
// //停止相机控制
|
||||
// public void StopCameraControl()
|
||||
// {
|
||||
// isCameraCtrl = false;
|
||||
// }
|
||||
|
||||
|
||||
//获取相机移动速度
|
||||
|
||||
@@ -8,7 +8,6 @@ using UnityEngine.AI;
|
||||
using System.Linq;
|
||||
public class CameraRover : ActionBase
|
||||
{
|
||||
private CameraControl cameraCtr2;
|
||||
private ControlMove cameraCtrl;
|
||||
private Vector3 targetPos = Vector3.zero; //视角坐标
|
||||
|
||||
@@ -32,14 +31,19 @@ public class CameraRover : ActionBase
|
||||
|
||||
public LayerMask obstacleLayer; // 障碍物层
|
||||
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// 确保初始化方法被调用,避免cameraCtrl为空
|
||||
if (cameraCtrl == null)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
cameraCtr2 = GetComponent<CameraControl>();
|
||||
cameraCtrl = GetComponent<ControlMove>();
|
||||
|
||||
|
||||
Debug.Log(cameraCtrl);
|
||||
currentAnim = "";
|
||||
isLookAt = false;
|
||||
}
|
||||
@@ -83,12 +87,12 @@ public class CameraRover : ActionBase
|
||||
|
||||
void StartCameraCtrl()
|
||||
{
|
||||
cameraCtr2.StartCameraControl();
|
||||
cameraCtrl.StartCameraControl();
|
||||
}
|
||||
|
||||
void StopCameraCtrl()
|
||||
{
|
||||
cameraCtr2.StopCameraControl();
|
||||
cameraCtrl.StopCameraControl();
|
||||
}
|
||||
|
||||
public void SetTargetPosition(Vector3 position)
|
||||
@@ -111,8 +115,8 @@ public class CameraRover : ActionBase
|
||||
StopCameraCtrl();
|
||||
cameraCtrl.GetInScriptCore();
|
||||
yield return new WaitForEndOfFrame();
|
||||
transform.DOMove(new Vector3(1828.729f, 158.0276f, 635.7281f), 2f);
|
||||
transform.DORotate(new Vector3(29.401f, -22.4f, 0f), 2f);
|
||||
transform.DOMove(new Vector3(-84.34684f, 16.32042f, 21.03517f), 2f);
|
||||
transform.DORotate(new Vector3(12.927f, -178.316f, 0f), 2f);
|
||||
yield return new WaitForSeconds(2f);
|
||||
StartCameraCtrl();
|
||||
}
|
||||
@@ -205,6 +209,8 @@ public class CameraRover : ActionBase
|
||||
|
||||
flightTime = Mathf.Max(flightTime, 0.1f);
|
||||
flightTime = Mathf.Min(flightTime, maxFlightTime);
|
||||
|
||||
|
||||
RaycastHit hit;
|
||||
// 射线检测是否有障碍物
|
||||
if (Physics.Raycast(transform.position, targetPosition - transform.position, out hit, distance, obstacleLayer))
|
||||
|
||||
@@ -1,37 +1,25 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class ControlMove : MonoBehaviour
|
||||
{
|
||||
private float moveSpeed = 50f; // 右键平移速度
|
||||
|
||||
[Header("滚轮缩放速度系数")]
|
||||
public float zoomSpeed = 10f; // 滚轮缩放速度
|
||||
|
||||
[Header("相机与水库中心的最大距离")]
|
||||
public float maxDistance = 600f; // 最大缩放距离
|
||||
|
||||
[Header("相机的最大高度限制")]
|
||||
public float maxHeight = 220f; // 最大高度限制
|
||||
|
||||
[Header("右键平移速度衰减系数")]
|
||||
public float rightClickPanSpeed = 100f; // 右键平移速度除数
|
||||
|
||||
public float moveSpeed = 50f; // 右键平移速度
|
||||
public float zoomSpeed = 10f; // 滚轮缩放速度
|
||||
// public ClickToFocus inScript; // 引用焦点脚本,提供 core
|
||||
private Vector3 inScript; // 引用焦点脚本,提供 core
|
||||
public float rotationSensitivity = 0.2f; // 左键拖拽旋转灵敏度
|
||||
//public float minPitch = -8f; // 最低俯仰角
|
||||
//public float maxPitch = 80f; // 最高俯仰角
|
||||
|
||||
[Header("左键拖拽旋转灵敏度系数")]
|
||||
public float rotationSensitivity = 0.2f; // 左键拖拽旋转灵敏度
|
||||
|
||||
private Camera cam; // 主相机引用
|
||||
private bool isRotating = false; // 是否正在旋转标志
|
||||
private Vector2 lastMousePos; // 上次鼠标位置(用于旋转计算)
|
||||
|
||||
[Header("初始距离中心")]
|
||||
public Vector3 reservoirCenter; // 水库中心坐标
|
||||
private Camera cam;
|
||||
private bool isRotating = false;
|
||||
private Vector2 lastMousePos;
|
||||
private Vector3 reservoirCenter = new Vector3(1551f, 25f, 1119f);
|
||||
private Rigidbody rb;
|
||||
|
||||
[Header("初始旋转中心")]
|
||||
public Vector3 startinScript; // 初始焦点位置
|
||||
|
||||
private Rigidbody rb; // 刚体组件(如需要物理模拟)
|
||||
private bool isCameraCtrl = true; // 相机是否可控制
|
||||
|
||||
//相机操作有效性判断
|
||||
@@ -45,144 +33,142 @@ public class ControlMove : MonoBehaviour
|
||||
{
|
||||
GetInScriptCore();
|
||||
}
|
||||
// Vector3 core = inScript.core;
|
||||
// if (inScript == null)
|
||||
// Debug.LogError("请在 Inspector 中把挂有 ClickToFocus 的物体拖给 inScript");
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (isCameraCtrl)
|
||||
if (!isCameraCtrl) return;
|
||||
if (inScript == null) return;
|
||||
//操作有效性判断
|
||||
if (EventSystem.current != null)
|
||||
{
|
||||
//操作有效性判断
|
||||
if (EventSystem.current != null)
|
||||
if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2))
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2))
|
||||
{
|
||||
isClickUI = EventSystem.current.IsPointerOverGameObject();
|
||||
}
|
||||
if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2))
|
||||
{
|
||||
isClickUI = false;
|
||||
}
|
||||
isClickUI = EventSystem.current.IsPointerOverGameObject();
|
||||
}
|
||||
if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2))
|
||||
{
|
||||
isClickUI = false;
|
||||
}
|
||||
}
|
||||
if (isClickUI) return;
|
||||
// Vector3 core = inScript.core;
|
||||
Vector3 core = inScript;
|
||||
|
||||
// —— 右键平移 ——
|
||||
if (Input.GetMouseButton(1))
|
||||
{
|
||||
moveSpeed = Vector3.Distance(core, transform.position) / 2f;//这里涉及到像素和实际空间米的关系转换
|
||||
float mx = Input.GetAxis("Mouse X");
|
||||
float my = Input.GetAxis("Mouse Y");
|
||||
Vector3 desiredPosition = transform.position + (-transform.right * mx + -transform.up * my) * moveSpeed * Time.deltaTime;
|
||||
|
||||
// 判断是否与障碍物发生碰撞
|
||||
if (!WillCollideWithObstacle(desiredPosition))
|
||||
{
|
||||
transform.position = desiredPosition;
|
||||
}
|
||||
}
|
||||
|
||||
// —— 滚轮缩放 ——
|
||||
float scroll = Input.GetAxis("Mouse ScrollWheel");
|
||||
if (Mathf.Abs(scroll) > 0.001f)
|
||||
{
|
||||
Vector3 desiredPosition = transform.position + transform.forward * scroll * zoomSpeed;
|
||||
|
||||
// 判断是否与障碍物发生碰撞
|
||||
if (!WillCollideWithObstacle(desiredPosition))
|
||||
{
|
||||
transform.position = desiredPosition;
|
||||
}
|
||||
}
|
||||
|
||||
// —— 左键开始/结束旋转 ——
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
isRotating = true;
|
||||
lastMousePos = Input.mousePosition;
|
||||
}
|
||||
if (Input.GetMouseButtonUp(0))
|
||||
{
|
||||
isRotating = false;
|
||||
}
|
||||
|
||||
// —— 左键拖拽:RotateAround 实现 + 俯仰限制 ——
|
||||
if (isRotating && Input.GetMouseButton(0))
|
||||
{
|
||||
Vector2 curr = Input.mousePosition;
|
||||
Vector2 delta = (curr - lastMousePos) * rotationSensitivity;
|
||||
lastMousePos = curr;
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
// 1. 水平绕世界 Y 轴旋转
|
||||
//Vector3 desiredPosition = cam.transform.position;
|
||||
//cam.transform.RotateAround(core, Vector3.up, delta.x);
|
||||
|
||||
Vector3 localPosHorizonal = transform.position - core;
|
||||
Quaternion rotationHorizonal = Quaternion.AngleAxis(delta.x, Vector3.up);
|
||||
Vector3 newLocalPosHorizonal = rotationHorizonal * localPosHorizonal;
|
||||
Vector3 newPosHorizonal = core + newLocalPosHorizonal;
|
||||
|
||||
|
||||
// 检查旋转后是否发生碰撞
|
||||
if (!WillCollideWithObstacle(newPosHorizonal))
|
||||
{
|
||||
// 如果没有碰撞,执行旋转
|
||||
transform.RotateAround(core, Vector3.up, delta.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果碰撞了,就不动
|
||||
|
||||
}
|
||||
|
||||
if (!isClickUI)
|
||||
// 2. 俯仰旋转
|
||||
Vector3 dir = (transform.position - core).normalized;
|
||||
Vector3 flat = new Vector3(dir.x, 0f, dir.z).normalized;
|
||||
float selfFlatX = transform.forward.x;
|
||||
float selfFlatZ = transform.forward.z;
|
||||
Vector3 selfFlat = new Vector3(selfFlatX, 0f, selfFlatZ).normalized;
|
||||
float selfPitch = Vector3.SignedAngle(selfFlat, transform.forward, transform.right);
|
||||
|
||||
|
||||
|
||||
if (selfPitch <= 80f && selfPitch >= 0f)
|
||||
{
|
||||
Vector3 core = inScript;
|
||||
// —— 右键平移 ——
|
||||
if (Input.GetMouseButton(1))
|
||||
|
||||
float pitchDelta = delta.y * -1f;
|
||||
|
||||
Vector3 localPosVertical = transform.position - core;
|
||||
Quaternion rotationVertical = Quaternion.AngleAxis(pitchDelta, transform.right);
|
||||
Vector3 newPosVertical = core + rotationVertical * localPosVertical;
|
||||
|
||||
|
||||
if (!WillCollideWithObstacle(newPosVertical))
|
||||
{
|
||||
moveSpeed = Vector3.Distance(core, transform.position) / 2f;
|
||||
float mx = Input.GetAxis("Mouse X");
|
||||
float my = Input.GetAxis("Mouse Y");
|
||||
|
||||
// Vector3 desiredPosition = transform.position + (-transform.right * mx + -transform.up * my) * moveSpeed * Time.deltaTime;
|
||||
Vector3 desiredPosition = transform.position + (-transform.right * mx + -transform.up * my) * moveSpeed / rightClickPanSpeed;
|
||||
|
||||
// 判断是否与障碍物发生碰撞
|
||||
if (!WillCollideWithObstacle(desiredPosition))
|
||||
{
|
||||
// transform.position = Vector3.Lerp(transform.position, desiredPosition, moveSpeed * Time.deltaTime);
|
||||
transform.position = desiredPosition;
|
||||
}
|
||||
transform.RotateAround(core, transform.right, pitchDelta);
|
||||
}
|
||||
|
||||
// —— 滚轮缩放 ——
|
||||
float scroll = Input.GetAxis("Mouse ScrollWheel");
|
||||
if (Mathf.Abs(scroll) > 0.001f)
|
||||
}
|
||||
else if (selfPitch > 80f)
|
||||
{
|
||||
float pitchDelta = delta.y * -1f;
|
||||
if (pitchDelta < 0f)
|
||||
{
|
||||
Vector3 desiredPosition = transform.position + transform.forward * scroll * zoomSpeed;
|
||||
|
||||
// 判断是否与障碍物发生碰撞
|
||||
if (!WillCollideWithObstacle(desiredPosition))
|
||||
{
|
||||
transform.position = desiredPosition;
|
||||
}
|
||||
transform.RotateAround(core, transform.right, pitchDelta);
|
||||
}
|
||||
|
||||
// —— 左键开始/结束旋转 ——
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
}
|
||||
else if (selfPitch < 0f)
|
||||
{
|
||||
float pitchDelta = delta.y * -1f;
|
||||
if (pitchDelta > 0f)
|
||||
{
|
||||
isRotating = true;
|
||||
lastMousePos = Input.mousePosition;
|
||||
}
|
||||
if (Input.GetMouseButtonUp(0))
|
||||
{
|
||||
isRotating = false;
|
||||
}
|
||||
|
||||
// —— 左键拖拽:RotateAround 实现 + 俯仰限制 ——
|
||||
if (isRotating && Input.GetMouseButton(0))
|
||||
{
|
||||
Vector2 curr = Input.mousePosition;
|
||||
Vector2 delta = (curr - lastMousePos) * rotationSensitivity;
|
||||
lastMousePos = curr;
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
// 1. 水平绕世界 Y 轴旋转
|
||||
//Vector3 desiredPosition = transform.position;
|
||||
//transform.RotateAround(core, Vector3.up, delta.x);
|
||||
|
||||
Vector3 localPosHorizonal = transform.position - core;
|
||||
Quaternion rotationHorizonal = Quaternion.AngleAxis(delta.x, Vector3.up);
|
||||
Vector3 newLocalPosHorizonal = rotationHorizonal * localPosHorizonal;
|
||||
Vector3 newPosHorizonal = core + newLocalPosHorizonal;
|
||||
|
||||
|
||||
// 检查旋转后是否发生碰撞
|
||||
if (!WillCollideWithObstacle(newPosHorizonal))
|
||||
{
|
||||
// 如果没有碰撞,执行旋转
|
||||
transform.RotateAround(core, Vector3.up, delta.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果碰撞了,撤销旋转,恢复到原来的位置
|
||||
|
||||
}
|
||||
|
||||
// 2. 俯仰旋转
|
||||
Vector3 dir = (transform.position - core).normalized;
|
||||
Vector3 flat = new Vector3(dir.x, 0f, dir.z).normalized;
|
||||
float selfFlatX = transform.forward.x;
|
||||
float selfFlatZ = transform.forward.z;
|
||||
Vector3 selfFlat = new Vector3(selfFlatX, 0f, selfFlatZ).normalized;
|
||||
float selfPitch = Vector3.SignedAngle(selfFlat, transform.forward, transform.right);
|
||||
|
||||
|
||||
|
||||
if (selfPitch <= 80f && selfPitch >= 0f)
|
||||
{
|
||||
|
||||
float pitchDelta = delta.y * -1f;
|
||||
|
||||
Vector3 localPosVertical = transform.position - core;
|
||||
Quaternion rotationVertical = Quaternion.AngleAxis(pitchDelta, transform.right);
|
||||
Vector3 newPosVertical = core + rotationVertical * localPosVertical;
|
||||
|
||||
|
||||
if (!WillCollideWithObstacle(newPosVertical))
|
||||
{
|
||||
transform.RotateAround(core, transform.right, pitchDelta);
|
||||
}
|
||||
|
||||
}
|
||||
else if (selfPitch > 80f)
|
||||
{
|
||||
float pitchDelta = delta.y * -1f;
|
||||
if (pitchDelta < 0f)
|
||||
{
|
||||
transform.RotateAround(core, transform.right, pitchDelta);
|
||||
}
|
||||
}
|
||||
else if (selfPitch < 0f)
|
||||
{
|
||||
float pitchDelta = delta.y * -1f;
|
||||
if (pitchDelta > 0f)
|
||||
{
|
||||
transform.RotateAround(core, transform.right, pitchDelta);
|
||||
}
|
||||
}
|
||||
transform.RotateAround(core,transform.right, pitchDelta);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,31 +183,31 @@ public class ControlMove : MonoBehaviour
|
||||
|
||||
// 使用 SphereCast 检查即将到达的位置是否会与障碍物发生碰撞
|
||||
RaycastHit hit;
|
||||
if (Physics.SphereCast(transform.position, 0.5f, moveDir.normalized, out hit, moveDist, LayerMask.GetMask("Default"), QueryTriggerInteraction.Collide))
|
||||
if (Physics.SphereCast(transform.position, 0.5f, moveDir, out hit, moveDist, LayerMask.GetMask("Default"), QueryTriggerInteraction.Collide))
|
||||
{
|
||||
// 如果检测到碰撞,返回 true
|
||||
// Debug.Log("collider");
|
||||
Debug.Log("collider");
|
||||
return true;
|
||||
}
|
||||
else if (Vector3.Distance(targetPosition, reservoirCenter) < maxDistance && targetPosition.y < maxHeight)
|
||||
else if (Mathf.Pow(targetPosition.x + 120f, 2f) + Mathf.Pow(targetPosition.z, 2f) < 10000f && targetPosition.y < 80f)
|
||||
{
|
||||
// 如果在范围内,返回 false
|
||||
return false;
|
||||
}
|
||||
else
|
||||
// Debug.Log("outRange");
|
||||
return true;
|
||||
Debug.Log("outRange");
|
||||
return true;//这个true是为了有返回值,实际上走不到这一步
|
||||
|
||||
}
|
||||
public void GetInScriptCore(Vector3 position)
|
||||
{
|
||||
inScript = position;
|
||||
}
|
||||
|
||||
public void GetInScriptCore()
|
||||
{
|
||||
inScript = startinScript;
|
||||
}
|
||||
public void GetInScriptCore(Vector3 position)
|
||||
{
|
||||
inScript = position;
|
||||
}
|
||||
|
||||
public void StartCameraControl()
|
||||
{
|
||||
@@ -234,4 +220,4 @@ public class ControlMove : MonoBehaviour
|
||||
{
|
||||
isCameraCtrl = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,37 +49,36 @@ public class SceneUtil : ActionBase
|
||||
if (AppCache.iconPointList02 == null) AppCache.iconPointList02 = new List<IconData>();
|
||||
if (AppCache.iconPointList03 == null) AppCache.iconPointList03 = new List<IconData>();
|
||||
if (AppCache.iconPointList04 == null) AppCache.iconPointList04 = new List<IconData>();
|
||||
if (AppCache.iconPointList05 == null) AppCache.iconPointList05 = new List<IconData>();
|
||||
|
||||
|
||||
// 初始化 GNSS 相关列表(12个设备)
|
||||
InitializeIconAndCameraLists("GNSS", "GNSS视角", AppCache.iconPointList01, AppCache.iconCameraList01,
|
||||
new string[] { "MS3P1474091067", "MS3P1474091121", "MS3P1474091071", "MS3P1474095003", "MS3P1474091068", "MS3P1474091157", "MS3P1474091039", "MS3P1474095149", "MS3P1474095150", "MS3P1474091234" },
|
||||
new string[] { "GNSS-WY-01", "GNSS-WY-02", "GNSS-WY-03", "GNSS-WY-04", "GNSS-WY-05", "GNSS-WY-06", "GNSS-WY-07", "GNSS-WY-08", "GNSS-WY-09", "GNSS基准点" },
|
||||
new string[] { "", "", "", "", "","", "", "", "", "" });
|
||||
new string[] { "ys_2026020450" },
|
||||
new string[] { "边坡-GNSS" },
|
||||
new string[] { "" });
|
||||
|
||||
// 初始化环境量监测相关列表(1个设备)
|
||||
InitializeIconAndCameraLists("水位监测", "水位监测视角", AppCache.iconPointList02, AppCache.iconCameraList02,
|
||||
new string[] { "1032406744" },
|
||||
new string[] { "凤凰水库水位监测" },
|
||||
new string[] { "FF29" });
|
||||
InitializeIconAndCameraLists("测斜仪监测", "测斜仪监测视角", AppCache.iconPointList02, AppCache.iconCameraList02,
|
||||
new string[] { "ys_2026020452" },
|
||||
new string[] { "固定测斜仪" },
|
||||
new string[] { "" });
|
||||
|
||||
// 初始化测缝针监测相关列表(9个设备)
|
||||
InitializeIconAndCameraLists("雨量监测", "雨量监测视角", AppCache.iconPointList03, AppCache.iconCameraList03,
|
||||
new string[] { "1032406744" },
|
||||
new string[] { "凤凰水库雨量站" },
|
||||
new string[] { "22" });
|
||||
new string[] { "ys_2026020454" },
|
||||
new string[] { "雨量计" },
|
||||
new string[] { "" });
|
||||
|
||||
// 初始化加速度振动监测相关列表(6个设备)
|
||||
InitializeIconAndCameraLists("渗压计监测", "渗压计监测视角", AppCache.iconPointList04, AppCache.iconCameraList04,
|
||||
new string[] { "1032406744", "1032406744","1032406744", "1032406744","1032406744", "1032406744","1032406744", "1032406744","1032406744", "1032406744",
|
||||
"1032406744", "1032406744","1032406744", "1032406744","1032406744", "1032406744","1032406744", "1032406744","1032406744", "1032406744","1032406744",
|
||||
"1032406744","1032406744", "1032406744","1032406744", "1032406744","1032406744", "1032406744","1032406744", "1032406744", "1032406744", "1032406744" },
|
||||
new string[] { "主坝断面CY1-1", "主坝断面CY1-2","主坝断面CY1-3", "主坝断面CY1-4","主坝断面CY1-5", "主坝断面CY2-1","主坝断面CY2-2", "主坝断面CY2-3","主坝断面CY2-4", "主坝断面CY2-5",
|
||||
"主坝断面CY3-1", "主坝断面CY3-2","主坝断面CY3-3", "主坝断面CY3-4","主坝断面CY3-5", "主坝断面CY4-1","主坝断面CY4-2", "主坝断面CY4-3","主坝断面CY4-4", "主坝断面CY4-5",
|
||||
"主坝断面CY5-1", "主坝断面CY5-2","主坝断面CY5-3", "主坝断面CY5-4","主坝断面CY5-5" , "副坝断面CY6-1","副坝断面CY6-2", "副坝断面CY6-3","主坝东量水堰", "主坝西量水堰", "副涵管量水堰", "梯形量水堰" },
|
||||
new string[] { "FF01", "FF02","FF03","FF04","FF05","FF06", "FF07","FF08","FF09","FF10",
|
||||
"FF11", "FF12","FF13","FF14","FF15","FF16", "FF17","FF18","FF19","FF20",
|
||||
"FF21", "FF22","FF23","FF24","FF25","FF26", "FF27","FF28","FF32", "FF31", "FF30", "FF33"});
|
||||
new string[] { "ys_2026020453" },
|
||||
new string[] { "渗压计" },
|
||||
new string[] { ""});
|
||||
InitializeIconAndCameraLists("位移监测", "位移监测视角", AppCache.iconPointList05, AppCache.iconCameraList05,
|
||||
new string[] { "ys_2026020451" },
|
||||
new string[] { "位移计" },
|
||||
new string[] { ""});
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,17 +4,20 @@ using UnityEngine;
|
||||
|
||||
public class ClickToFocus : MonoBehaviour
|
||||
{
|
||||
//[Tooltip("相机在目标物体位置的偏移量")] public Vector3 cameraOffset = new Vector3(5f, 10f, 0f);
|
||||
private Dictionary<string, Vector3> targetObjectAndPosition = new Dictionary<string, Vector3>();//尝试使用字典数据类型来定义每一个物体自己对应的观察点位置
|
||||
//[Tooltip("相机在目标物体位置的偏移量")] public Vector3 cameraOffset = new Vector3(5f, 10f, 0f);
|
||||
private Dictionary<string, Vector3> targetObjectAndPosition = new Dictionary<string, Vector3>();//尝试使用字典数据类型来定义每一个物体自己对应的观察点位置
|
||||
|
||||
[Tooltip("平滑过渡所用时间(秒)")] public float transitionDuration = 1.0f;
|
||||
[Header("双击设置")]
|
||||
[Tooltip("双击间隔时间阈值(秒)")] public float doubleClickInterval = 0.3f;
|
||||
[Tooltip("平滑过渡所用时间(秒)")] public float transitionDuration = 1.0f;
|
||||
[Header("双击设置")]
|
||||
[Tooltip("双击间隔时间阈值(秒)")] public float doubleClickInterval = 0.3f;
|
||||
private float lastClickTime = 0f;
|
||||
private bool waitingSecondClick = false;
|
||||
|
||||
|
||||
private Camera mainCamera;
|
||||
|
||||
private ControlMove cameraCtrl;
|
||||
|
||||
public Vector3 core = new Vector3(-90f, 7.2f, -19.9f);
|
||||
|
||||
//public GameObject lastObj;
|
||||
@@ -23,10 +26,15 @@ public class ClickToFocus : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
core = new Vector3(-90f, 7.2f, -19.9f);
|
||||
// 确保初始化方法被调用,避免cameraCtrl为空
|
||||
if (cameraCtrl == null)
|
||||
{
|
||||
cameraCtrl = GetComponent<ControlMove>();
|
||||
}
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
mainCamera = Camera.main;//主相机的那个Camera组件跳转到的观测点
|
||||
mainCamera = Camera.main;//主相机的那个Camera组件跳转到的观测点
|
||||
targetObjectAndPosition.Add("sb_cexieyi001", new Vector3(-72.4f, 7.2f, -19.9f));
|
||||
targetObjectAndPosition.Add("sb_cexieyi003", new Vector3(-90f, 7.2f, -19.9f));
|
||||
targetObjectAndPosition.Add("sb_cexieyi005", new Vector3(-145.5f, 7.2f, -19.9f));
|
||||
@@ -88,20 +96,21 @@ public class ClickToFocus : MonoBehaviour
|
||||
private void HandleClick()
|
||||
{
|
||||
Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition);
|
||||
if (Physics.Raycast(ray, out RaycastHit hit, Mathf.Infinity) && hit.collider.CompareTag("Target"))//这里有点小问题,应该给被打中的物体加一个标签,不然正常物体也会影响core
|
||||
if (Physics.Raycast(ray, out RaycastHit hit, Mathf.Infinity) && hit.collider.CompareTag("Target"))//这里有点小问题,应该给被打中的物体加一个标签,不然正常物体也会影响core
|
||||
{
|
||||
//出一个hit
|
||||
//出一个hit
|
||||
foreach (KeyValuePair<string, Vector3> pair in targetObjectAndPosition)
|
||||
{
|
||||
if (hit.transform.gameObject.name == pair.Key)
|
||||
{
|
||||
Vector3 targetPos = pair.Value;
|
||||
StartCoroutine(MoveCamera(mainCamera, targetPos, transitionDuration, hit.transform));
|
||||
|
||||
}
|
||||
}
|
||||
core = hit.transform.position;
|
||||
|
||||
//中间夹着的代码为提供红色高亮显示的功能,和双击跳转是分开的
|
||||
//中间夹着的代码为提供红色高亮显示的功能,和双击跳转是分开的
|
||||
//if (lastObj == null)
|
||||
//{
|
||||
// currentObj = hit.collider.GetComponent<Transform>().gameObject;
|
||||
@@ -116,8 +125,8 @@ public class ClickToFocus : MonoBehaviour
|
||||
|
||||
//}
|
||||
|
||||
// lastObj = currentObj;
|
||||
//中间夹着的代码为提供红色高亮显示的功能,和双击跳转是分开的
|
||||
// lastObj = currentObj;
|
||||
//中间夹着的代码为提供红色高亮显示的功能,和双击跳转是分开的
|
||||
}
|
||||
|
||||
|
||||
@@ -126,19 +135,20 @@ public class ClickToFocus : MonoBehaviour
|
||||
|
||||
private IEnumerator MoveCamera(Camera cam, Vector3 targetPos, float duration, Transform focusTarget)
|
||||
{
|
||||
Vector3 startPos = cam.transform.position;
|
||||
Vector3 startPos = transform.position;
|
||||
cameraCtrl.GetInScriptCore(targetPos);
|
||||
float elapsed = 0f;
|
||||
while (elapsed < duration)
|
||||
{
|
||||
float t = Mathf.Lerp(0f, 1f, elapsed / duration);
|
||||
cam.transform.position = Vector3.Lerp(startPos, targetPos, t);
|
||||
transform.position = Vector3.Lerp(startPos, targetPos, t);
|
||||
if (focusTarget != null)
|
||||
cam.transform.LookAt(focusTarget);
|
||||
transform.LookAt(focusTarget);
|
||||
elapsed += Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
cam.transform.position = targetPos;
|
||||
transform.position = targetPos;
|
||||
if (focusTarget != null)
|
||||
cam.transform.LookAt(focusTarget);
|
||||
transform.LookAt(focusTarget);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class ControlMoveWithCollider : MonoBehaviour
|
||||
{
|
||||
public float moveSpeed = 50f; // 右键平移速度
|
||||
public float zoomSpeed = 10f; // 滚轮缩放速度
|
||||
public ClickToFocus inScript; // 引用焦点脚本,提供 core
|
||||
public float rotationSensitivity = 0.2f; // 左键拖拽旋转灵敏度
|
||||
//public float minPitch = -8f; // 最低俯仰角
|
||||
//public float maxPitch = 80f; // 最高俯仰角
|
||||
public float moveSpeed = 50f; // 右键平移速度
|
||||
public float zoomSpeed = 10f; // 滚轮缩放速度
|
||||
public ClickToFocus inScript; // 引用焦点脚本,提供 core
|
||||
public float rotationSensitivity = 0.2f; // 左键拖拽旋转灵敏度
|
||||
//public float minPitch = -8f; // 最低俯仰角
|
||||
//public float maxPitch = 80f; // 最高俯仰角
|
||||
|
||||
private Camera cam;
|
||||
private bool isRotating = false;
|
||||
@@ -15,51 +16,68 @@ public class ControlMoveWithCollider : MonoBehaviour
|
||||
private Vector3 reservoirCenter = new Vector3(1551f, 25f, 1119f);
|
||||
private Rigidbody rb;
|
||||
|
||||
private bool isCameraCtrl = true; // 相机是否可控制
|
||||
|
||||
//相机操作有效性判断
|
||||
private bool isClickUI = false;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rb = GetComponent<Rigidbody>();
|
||||
cam = Camera.main;
|
||||
Vector3 core = inScript.core;
|
||||
if (inScript == null)
|
||||
Debug.LogError("请在 Inspector 中把挂有 ClickToFocus 的物体拖给 inScript");
|
||||
Debug.LogError("请在 Inspector 中把挂有 ClickToFocus 的物体拖给 inScript");
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
//if (SliderDragDetector.isSliderDragging)
|
||||
// return;
|
||||
if (!isCameraCtrl) return;
|
||||
if (inScript == null) return;
|
||||
//操作有效性判断
|
||||
if (EventSystem.current != null)
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2))
|
||||
{
|
||||
isClickUI = EventSystem.current.IsPointerOverGameObject();
|
||||
}
|
||||
if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2))
|
||||
{
|
||||
isClickUI = false;
|
||||
}
|
||||
}
|
||||
if (isClickUI) return;
|
||||
Vector3 core = inScript.core;
|
||||
|
||||
// —— 右键平移 ——
|
||||
// —— 右键平移 ——
|
||||
if (Input.GetMouseButton(1))
|
||||
{
|
||||
moveSpeed = Vector3.Distance(core, transform.position) / 2f;//这里涉及到像素和实际空间米的关系转换
|
||||
moveSpeed = Vector3.Distance(core, transform.position) / 2f;//这里涉及到像素和实际空间米的关系转换
|
||||
float mx = Input.GetAxis("Mouse X");
|
||||
float my = Input.GetAxis("Mouse Y");
|
||||
Vector3 desiredPosition = cam.transform.position + (-cam.transform.right * mx + -cam.transform.up * my) * moveSpeed * Time.deltaTime;
|
||||
|
||||
// 判断是否与障碍物发生碰撞
|
||||
// 判断是否与障碍物发生碰撞
|
||||
if (!WillCollideWithObstacle(desiredPosition))
|
||||
{
|
||||
cam.transform.position = desiredPosition;
|
||||
}
|
||||
}
|
||||
|
||||
// —— 滚轮缩放 ——
|
||||
// —— 滚轮缩放 ——
|
||||
float scroll = Input.GetAxis("Mouse ScrollWheel");
|
||||
if (Mathf.Abs(scroll) > 0.001f)
|
||||
{
|
||||
Vector3 desiredPosition = cam.transform.position + cam.transform.forward * scroll * zoomSpeed;
|
||||
|
||||
// 判断是否与障碍物发生碰撞
|
||||
// 判断是否与障碍物发生碰撞
|
||||
if (!WillCollideWithObstacle(desiredPosition))
|
||||
{
|
||||
cam.transform.position = desiredPosition;
|
||||
}
|
||||
}
|
||||
|
||||
// —— 左键开始/结束旋转 ——
|
||||
// —— 左键开始/结束旋转 ——
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
isRotating = true;
|
||||
@@ -70,7 +88,7 @@ public class ControlMoveWithCollider : MonoBehaviour
|
||||
isRotating = false;
|
||||
}
|
||||
|
||||
// —— 左键拖拽:RotateAround 实现 + 俯仰限制 ——
|
||||
// —— 左键拖拽:RotateAround 实现 + 俯仰限制 ——
|
||||
if (isRotating && Input.GetMouseButton(0))
|
||||
{
|
||||
Vector2 curr = Input.mousePosition;
|
||||
@@ -80,7 +98,7 @@ public class ControlMoveWithCollider : MonoBehaviour
|
||||
/*
|
||||
|
||||
*/
|
||||
// 1. 水平绕世界 Y 轴旋转
|
||||
// 1. 水平绕世界 Y 轴旋转
|
||||
//Vector3 desiredPosition = cam.transform.position;
|
||||
//cam.transform.RotateAround(core, Vector3.up, delta.x);
|
||||
|
||||
@@ -90,19 +108,19 @@ public class ControlMoveWithCollider : MonoBehaviour
|
||||
Vector3 newPosHorizonal = core + newLocalPosHorizonal;
|
||||
|
||||
|
||||
// 检查旋转后是否发生碰撞
|
||||
// 检查旋转后是否发生碰撞
|
||||
if (!WillCollideWithObstacle(newPosHorizonal))
|
||||
{
|
||||
// 如果没有碰撞,执行旋转
|
||||
// 如果没有碰撞,执行旋转
|
||||
cam.transform.RotateAround(core, Vector3.up, delta.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果碰撞了,就不动
|
||||
// 如果碰撞了,就不动
|
||||
|
||||
}
|
||||
|
||||
// 2. 俯仰旋转
|
||||
// 2. 俯仰旋转
|
||||
Vector3 dir = (cam.transform.position - core).normalized;
|
||||
Vector3 flat = new Vector3(dir.x, 0f, dir.z).normalized;
|
||||
float selfFlatX = cam.transform.forward.x;
|
||||
@@ -147,29 +165,45 @@ public class ControlMoveWithCollider : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// 碰撞检测方法
|
||||
// 碰撞检测方法
|
||||
bool WillCollideWithObstacle(Vector3 targetPosition)
|
||||
{
|
||||
// 计算从当前位置到目标位置的方向和距离
|
||||
// 计算从当前位置到目标位置的方向和距离
|
||||
Vector3 moveDir = targetPosition - cam.transform.position;
|
||||
float moveDist = moveDir.magnitude;
|
||||
|
||||
// 使用 SphereCast 检查即将到达的位置是否会与障碍物发生碰撞
|
||||
// 使用 SphereCast 检查即将到达的位置是否会与障碍物发生碰撞
|
||||
RaycastHit hit;
|
||||
if (Physics.SphereCast(cam.transform.position, 0.5f, moveDir, out hit, moveDist, LayerMask.GetMask("Default"), QueryTriggerInteraction.Collide) )
|
||||
if (Physics.SphereCast(cam.transform.position, 0.5f, moveDir, out hit, moveDist, LayerMask.GetMask("Default"), QueryTriggerInteraction.Collide))
|
||||
{
|
||||
// 如果检测到碰撞,返回 true
|
||||
// 如果检测到碰撞,返回 true
|
||||
Debug.Log("collider");
|
||||
return true;
|
||||
}
|
||||
else if ( Mathf.Pow(targetPosition.x+120f, 2f)+ Mathf.Pow(targetPosition.z , 2f)<10000f && targetPosition.y<80f)
|
||||
else if (Mathf.Pow(targetPosition.x + 120f, 2f) + Mathf.Pow(targetPosition.z, 2f) < 10000f && targetPosition.y < 80f)
|
||||
{
|
||||
// 如果在范围内,返回 false
|
||||
// 如果在范围内,返回 false
|
||||
return false;
|
||||
}
|
||||
else
|
||||
Debug.Log("outRange");
|
||||
return true;//这个true是为了有返回值,实际上走不到这一步
|
||||
return true;//这个true是为了有返回值,实际上走不到这一步
|
||||
|
||||
}
|
||||
}
|
||||
public void GetInScriptCore(Vector3 position)
|
||||
{
|
||||
inScript.core = position;
|
||||
}
|
||||
|
||||
public void StartCameraControl()
|
||||
{
|
||||
isCameraCtrl = true;
|
||||
isClickUI = false;
|
||||
}
|
||||
|
||||
//停止相机控制
|
||||
public void StopCameraControl()
|
||||
{
|
||||
isCameraCtrl = false;
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class WebService : MonoBehaviour
|
||||
{
|
||||
UnityWebRequest unityWeb = UnityWebRequest.Get(url);
|
||||
unityWeb.downloadHandler = new DownloadHandlerBuffer();
|
||||
unityWeb.SetRequestHeader("Authorization", "tenantCode=CZFHSK&accessToken=52060d8c71d0e4a2d97c1b900acc8b1fa3a6928d");
|
||||
unityWeb.SetRequestHeader("Authorization", "tenantCode=DEMO&accessToken=225e1a7ffede96cb5adab3aa98775660f4c6a066");
|
||||
|
||||
yield return unityWeb.SendWebRequest();
|
||||
if (unityWeb.result != UnityWebRequest.Result.ConnectionError && unityWeb.result != UnityWebRequest.Result.ProtocolError)
|
||||
@@ -120,7 +120,7 @@ public class WebService : MonoBehaviour
|
||||
{
|
||||
UnityWebRequest unityWeb = UnityWebRequest.Get(url);
|
||||
unityWeb.downloadHandler = new DownloadHandlerBuffer();
|
||||
unityWeb.SetRequestHeader("Authorization", "tenantCode=CZFHSK&accessToken=52060d8c71d0e4a2d97c1b900acc8b1fa3a6928d");
|
||||
unityWeb.SetRequestHeader("Authorization", "tenantCode=DEMO&accessToken=225e1a7ffede96cb5adab3aa98775660f4c6a066");
|
||||
|
||||
yield return unityWeb.SendWebRequest();
|
||||
T t = null;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class PnlIcon : ActionBase
|
||||
{ PageType.Icon02, new List<GameObject>() },
|
||||
{ PageType.Icon03, new List<GameObject>() },
|
||||
{ PageType.Icon04, new List<GameObject>() },
|
||||
// { PageType.Icon05, new List<GameObject>() }
|
||||
{ PageType.Icon05, new List<GameObject>() }
|
||||
};
|
||||
private Dictionary<PageType, List<IconData>> appCacheLists;
|
||||
private void InitializeAppCacheLists()
|
||||
@@ -29,15 +29,17 @@ public class PnlIcon : ActionBase
|
||||
{ PageType.Icon02, AppCache.iconPointList02 },
|
||||
{ PageType.Icon03, AppCache.iconPointList03 },
|
||||
{ PageType.Icon04, AppCache.iconPointList04 },
|
||||
{ PageType.Icon05, AppCache.iconPointList05 }
|
||||
};
|
||||
}
|
||||
|
||||
private Dictionary<PageType, string> textPrefixes = new Dictionary<PageType, string>
|
||||
{
|
||||
{ PageType.Icon01, "gnss监测" },
|
||||
{ PageType.Icon02, "水位" },
|
||||
{ PageType.Icon02, "测斜仪监测" },
|
||||
{ PageType.Icon03, "雨量监测" },
|
||||
{ PageType.Icon04, "渗压计监测" },
|
||||
{ PageType.Icon05, "位移监测" }
|
||||
};
|
||||
|
||||
private Dictionary<PageType, string> prefabPaths = new Dictionary<PageType, string>
|
||||
@@ -46,14 +48,16 @@ public class PnlIcon : ActionBase
|
||||
{ PageType.Icon02, "Icon2D/iconPrefab" },
|
||||
{ PageType.Icon03, "Icon2D/iconPrefab" },
|
||||
{ PageType.Icon04, "Icon2D/iconPrefab" },
|
||||
{ PageType.Icon05, "Icon2D/iconPrefab" }
|
||||
};
|
||||
|
||||
private static readonly Dictionary<PageType, string> IconMapping = new Dictionary<PageType, string>
|
||||
{
|
||||
{ PageType.Icon01, "MT014" },
|
||||
{ PageType.Icon02, "MT011" },
|
||||
{ PageType.Icon02, "MT016" },
|
||||
{ PageType.Icon03, "MT002" },
|
||||
{ PageType.Icon04, "MT032" }
|
||||
{ PageType.Icon04, "MT031" },
|
||||
{ PageType.Icon05, "MT013" }
|
||||
};
|
||||
private GameObject Player;
|
||||
private CameraRover cameraRover;
|
||||
@@ -255,7 +259,8 @@ public class PnlIcon : ActionBase
|
||||
return AppCache.iconPointList01 != null &&
|
||||
AppCache.iconPointList02 != null &&
|
||||
AppCache.iconPointList03 != null &&
|
||||
AppCache.iconPointList04 != null;
|
||||
AppCache.iconPointList04 != null &&
|
||||
AppCache.iconPointList05 != null;
|
||||
}
|
||||
|
||||
void CloseIcon(PageType type)
|
||||
|
||||
@@ -7,7 +7,7 @@ using UnityEngine.UI;
|
||||
|
||||
public class PnlMain : ActionBase
|
||||
{
|
||||
private const int ButtonCount = 5;
|
||||
private const int ButtonCount = 6;
|
||||
private List<Button> buttons = new List<Button>();
|
||||
private List<Action> clickActions = new List<Action>();
|
||||
|
||||
@@ -25,15 +25,15 @@ public class PnlMain : ActionBase
|
||||
{
|
||||
new PageActionParams
|
||||
{
|
||||
closePageTypes = new List<PageType> { PageType.Icon01,PageType.Icon02, PageType.Icon03, PageType.Icon04 },
|
||||
openPageType = new List<PageType> { PageType.Icon01,PageType.Icon02, PageType.Icon03, PageType.Icon04 },
|
||||
closePageTypes = new List<PageType> { PageType.Icon01,PageType.Icon02, PageType.Icon03, PageType.Icon04,PageType.Icon05 },
|
||||
openPageType = new List<PageType> { PageType.Icon01,PageType.Icon02, PageType.Icon03, PageType.Icon04,PageType.Icon05 },
|
||||
actionPageType = PageType.Camera1,
|
||||
openDelay = 1f,
|
||||
buttonName = "all"
|
||||
},
|
||||
new PageActionParams
|
||||
{
|
||||
closePageTypes = new List<PageType> { PageType.Icon01,PageType.Icon02, PageType.Icon03, PageType.Icon04 },
|
||||
closePageTypes = new List<PageType> { PageType.Icon01,PageType.Icon02, PageType.Icon03, PageType.Icon04,PageType.Icon05 },
|
||||
openPageType = new List<PageType> { PageType.Icon01 },
|
||||
actionPageType = PageType.Camera1,
|
||||
openDelay = 1f,
|
||||
@@ -41,15 +41,15 @@ public class PnlMain : ActionBase
|
||||
},
|
||||
new PageActionParams
|
||||
{
|
||||
closePageTypes = new List<PageType> { PageType.Icon01,PageType.Icon02, PageType.Icon03, PageType.Icon04 },
|
||||
closePageTypes = new List<PageType> { PageType.Icon01,PageType.Icon02, PageType.Icon03, PageType.Icon04,PageType.Icon05 },
|
||||
openPageType = new List<PageType> { PageType.Icon02 },
|
||||
actionPageType = PageType.Camera2,
|
||||
openDelay = 1f,
|
||||
buttonName = "水位"
|
||||
buttonName = "测斜仪监测"
|
||||
},
|
||||
new PageActionParams
|
||||
{
|
||||
closePageTypes = new List<PageType> { PageType.Icon01, PageType.Icon02,PageType.Icon03, PageType.Icon04 },
|
||||
closePageTypes = new List<PageType> { PageType.Icon01, PageType.Icon02,PageType.Icon03, PageType.Icon04,PageType.Icon05 },
|
||||
openPageType = new List<PageType> { PageType.Icon03 },
|
||||
actionPageType = PageType.Camera1,
|
||||
openDelay = 1f,
|
||||
@@ -57,12 +57,20 @@ public class PnlMain : ActionBase
|
||||
},
|
||||
new PageActionParams
|
||||
{
|
||||
closePageTypes = new List<PageType> { PageType.Icon01, PageType.Icon02, PageType.Icon03,PageType.Icon04 },
|
||||
closePageTypes = new List<PageType> { PageType.Icon01, PageType.Icon02, PageType.Icon03,PageType.Icon04,PageType.Icon05 },
|
||||
openPageType = new List<PageType> { PageType.Icon04 },
|
||||
actionPageType = PageType.Camera1,
|
||||
openDelay = 1f,
|
||||
buttonName = "渗压计监测"
|
||||
}
|
||||
},
|
||||
new PageActionParams
|
||||
{
|
||||
closePageTypes = new List<PageType> { PageType.Icon01, PageType.Icon02, PageType.Icon03,PageType.Icon04,PageType.Icon05 },
|
||||
openPageType = new List<PageType> { PageType.Icon05 },
|
||||
actionPageType = PageType.Camera1,
|
||||
openDelay = 1f,
|
||||
buttonName = "位移监测"
|
||||
},
|
||||
};
|
||||
|
||||
public override void Init()
|
||||
|
||||
Reference in New Issue
Block a user