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 @@
-
+