From 8caed7288639e81e95a49888405f3727a46147fb Mon Sep 17 00:00:00 2001
From: shenjianxing <”315615051@qq.com“>
Date: Tue, 31 Dec 2024 16:24:35 +0800
Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=8F=8D=E9=A6=88=20?=
=?UTF-8?q?=E6=8A=8A=E9=95=9C=E5=A4=B4=E5=88=87=E6=8D=A2=E6=94=B9=E4=B8=BA?=
=?UTF-8?q?=E4=B8=8D=E5=BC=BA=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Assets/Art/UIPrefab/UICameraSwitch.prefab | 2 +-
Assets/Scripts/Actions/CameraSwitchAction.cs | 10 +++-
Assets/Scripts/UI/UICameraSwitch.cs | 48 +++++++++++---------
Doc/Xml配置文档.xml | 4 +-
4 files changed, 39 insertions(+), 25 deletions(-)
diff --git a/Assets/Art/UIPrefab/UICameraSwitch.prefab b/Assets/Art/UIPrefab/UICameraSwitch.prefab
index 0157920f..92fbe6e1 100644
--- a/Assets/Art/UIPrefab/UICameraSwitch.prefab
+++ b/Assets/Art/UIPrefab/UICameraSwitch.prefab
@@ -529,7 +529,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2fafe2cfe61f6974895a912c3755e8f1, type: 3}
m_Name:
m_EditorClassIdentifier:
- m_AllowSwitchOff: 0
+ m_AllowSwitchOff: 1
--- !u!1 &5353223196711954198
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/Scripts/Actions/CameraSwitchAction.cs b/Assets/Scripts/Actions/CameraSwitchAction.cs
index 586497a8..82fbcb98 100644
--- a/Assets/Scripts/Actions/CameraSwitchAction.cs
+++ b/Assets/Scripts/Actions/CameraSwitchAction.cs
@@ -64,7 +64,15 @@ namespace QFramework
data.normalRot = Utility.GetVector3FromStrArray(datas["normalRot"]);
}
- bool.TryParse(datas["isNear"], out data.isNear);
+ if (datas.ContainsKey("isNear") == false)
+ {
+ data.NotRun = true;
+ }
+ else
+ {
+ data.NotRun = false;
+ bool.TryParse(datas["isNear"], out data.isNear);
+ }
float.TryParse(datas["nearTime"], out data.nearTime);
float.TryParse(datas["normalTime"], out data.normalTime);
diff --git a/Assets/Scripts/UI/UICameraSwitch.cs b/Assets/Scripts/UI/UICameraSwitch.cs
index 532f5fe4..60f36643 100644
--- a/Assets/Scripts/UI/UICameraSwitch.cs
+++ b/Assets/Scripts/UI/UICameraSwitch.cs
@@ -17,6 +17,7 @@ namespace QFramework.Example
public float nearTime;
public float normalTime;
public bool isNear;
+ public bool NotRun;
}
public partial class UICameraSwitch : UIPanel
@@ -59,29 +60,32 @@ namespace QFramework.Example
{
mData = uiData as UICameraSwitchData ?? new UICameraSwitchData();
+ if (mData.NotRun==false)
+ {
+ if (mData.isNear)
+ {
+ if (Near.isOn == false)
+ {
+ Near.isOn = true;
+ }
+ else
+ {
+ SetNear();
+ }
+ }
+ else
+ {
+ if (Far.isOn == false)
+ {
+ Far.isOn = true;
+ }
+ else
+ {
+ SetNormal();
+ }
+ }
+ }
- //if (mData.isNear)
- //{
- // if (Near.isOn == false)
- // {
- // Near.isOn = true;
- // }
- // else
- // {
- // SetNear();
- // }
- //}
- //else
- //{
- // if (Far.isOn == false)
- // {
- // Far.isOn = true;
- // }
- // else
- // {
- // SetNormal();
- // }
- //}
}
protected override void OnShow()
diff --git a/Doc/Xml配置文档.xml b/Doc/Xml配置文档.xml
index 4c5ab3e3..06d2e0f3 100644
--- a/Doc/Xml配置文档.xml
+++ b/Doc/Xml配置文档.xml
@@ -48,7 +48,9 @@
-
+