根据反馈修改UI组件使用方式

This commit is contained in:
shenjianxing 2024-12-31 16:31:32 +08:00
parent 8caed72886
commit 3e4d87b0ca
4 changed files with 8 additions and 46 deletions

View File

@ -64,15 +64,6 @@ namespace QFramework
data.normalRot = Utility.GetVector3FromStrArray(datas["normalRot"]); data.normalRot = Utility.GetVector3FromStrArray(datas["normalRot"]);
} }
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["nearTime"], out data.nearTime);
float.TryParse(datas["normalTime"], out data.normalTime); float.TryParse(datas["normalTime"], out data.normalTime);

View File

@ -16,8 +16,6 @@ namespace QFramework.Example
public Vector3 normalRot; public Vector3 normalRot;
public float nearTime; public float nearTime;
public float normalTime; public float normalTime;
public bool isNear;
public bool NotRun;
} }
public partial class UICameraSwitch : UIPanel public partial class UICameraSwitch : UIPanel
@ -60,32 +58,14 @@ namespace QFramework.Example
{ {
mData = uiData as UICameraSwitchData ?? new UICameraSwitchData(); mData = uiData as UICameraSwitchData ?? new UICameraSwitchData();
if (mData.NotRun==false) if (Near.isOn)
{ {
if (mData.isNear) SetNear();
{ }
if (Near.isOn == false) if (Far.isOn)
{ {
Near.isOn = true; SetNormal();
}
else
{
SetNear();
}
}
else
{
if (Far.isOn == false)
{
Far.isOn = true;
}
else
{
SetNormal();
}
}
} }
} }
protected override void OnShow() protected override void OnShow()

View File

@ -655,15 +655,6 @@ namespace XMLTool
{ {
act.args.Add("normalTime", "0"); act.args.Add("normalTime", "0");
} }
XAttribute isNear = action.Attribute("isNear");
if (isNear != null)
{
act.args.Add("isNear", isNear.Value);
}
else
{
act.args.Add("isNear", "false");
}
newAction = act; newAction = act;
} }
break; break;

View File

@ -49,9 +49,9 @@
<!--设置分数 与Score配合使用 步骤名字一定要是step+name--> <!--设置分数 与Score配合使用 步骤名字一定要是step+name-->
<Action type="SetScore" name="步骤名字" value="1"></Action> <Action type="SetScore" name="步骤名字" value="1"></Action>
<!--镜头切换 近距离和默认 如果有了nearDevice就可以不用nearPos和nearRot了 按照device的坐标和旋转来处理镜头 normalDevice同理 <!--镜头切换 近距离和默认 如果有了nearDevice就可以不用nearPos和nearRot了 按照device的坐标和旋转来处理镜头 normalDevice同理
isNear 如果不写 则默认不执行镜头切换 只设置坐标 不执行镜头切换 是否执行要根据UI的按钮操作来
--> -->
<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> <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"></Action>
<!--文字弹窗 按钮可以多个 点击事件使用UIClick--> <!--文字弹窗 按钮可以多个 点击事件使用UIClick-->
<Action type="TextTip" value="这里是文字描述" audio="q001.mp3" btns="确定,取消"/> <Action type="TextTip" value="这里是文字描述" audio="q001.mp3" btns="确定,取消"/>
<!--锁定镜头 value为是否锁定--> <!--锁定镜头 value为是否锁定-->