根据反馈 把镜头切换改为不强制

This commit is contained in:
shenjianxing 2024-12-31 16:24:35 +08:00
parent c25830a670
commit 8caed72886
4 changed files with 39 additions and 25 deletions

View File

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

View File

@ -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);

View File

@ -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()

View File

@ -48,7 +48,9 @@
<Action type="Var" name="变量名" value="1"></Action>
<!--设置分数 与Score配合使用 步骤名字一定要是step+name-->
<Action type="SetScore" name="步骤名字" value="1"></Action>
<!--镜头切换 近距离和默认 如果有了nearDevice就可以不用nearPos和nearRot了 按照device的坐标和旋转来处理镜头 normalDevice同理-->
<!--镜头切换 近距离和默认 如果有了nearDevice就可以不用nearPos和nearRot了 按照device的坐标和旋转来处理镜头 normalDevice同理
isNear 如果不写 则默认不执行镜头切换
-->
<Action type="CameraSwitch" nearDevice="肠钳" normalDevice="组织钳" nearPos="-3.942,3.24,-4.319" nearRot="16.42331,180,0" nearTime="1" normalPos="-3.942,3.24,-3.946" normalRot="16.42331,180,-5.305351E-14" normalTime="1" isNear="false"></Action>
<!--文字弹窗 按钮可以多个 点击事件使用UIClick-->
<Action type="TextTip" value="这里是文字描述" audio="q001.mp3" btns="确定,取消"/>