扩展cameraSwitch功能
This commit is contained in:
parent
c24cfe0832
commit
10f1b0b052
@ -46,10 +46,15 @@ namespace QFramework
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (datas.ContainsKey("nearPos"))
|
||||
{
|
||||
data.nearPos = Utility.GetVector3FromStrArray(datas["nearPos"]);
|
||||
}
|
||||
if (datas.ContainsKey("nearRot"))
|
||||
{
|
||||
data.nearRot = Utility.GetVector3FromStrArray(datas["nearRot"]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (datas.ContainsKey("normalDevice"))
|
||||
@ -59,10 +64,16 @@ namespace QFramework
|
||||
data.normalRot = obj.EulerAngles();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (datas.ContainsKey("normalPos"))
|
||||
{
|
||||
data.normalPos = Utility.GetVector3FromStrArray(datas["normalPos"]);
|
||||
}
|
||||
if (datas.ContainsKey("normalRot"))
|
||||
{
|
||||
data.normalRot = Utility.GetVector3FromStrArray(datas["normalRot"]);
|
||||
}
|
||||
}
|
||||
if (datas.ContainsKey("isOn"))
|
||||
{
|
||||
data.isOn = datas["isOn"];
|
||||
|
||||
@ -59,6 +59,11 @@ namespace QFramework.Example
|
||||
protected override void OnOpen(IUIData uiData = null)
|
||||
{
|
||||
mData = uiData as UICameraSwitchData ?? new UICameraSwitchData();
|
||||
|
||||
Near.gameObject.SetActive(mData.nearPos != default);
|
||||
Far.gameObject.SetActive(mData.normalPos != default);
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(mData.isOn))
|
||||
{
|
||||
if (Near.isOn)
|
||||
@ -96,6 +101,8 @@ namespace QFramework.Example
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
@ -74,6 +74,7 @@
|
||||
<Action type="SetScore" name="步骤名字" value="1"></Action>
|
||||
<!--镜头切换 近距离和默认 如果有了nearDevice就可以不用nearPos和nearRot了 按照device的坐标和旋转来处理镜头 normalDevice同理
|
||||
只设置坐标 不执行镜头切换 是否执行要根据UI的按钮操作来
|
||||
如果不配置 nearPos或者normalPos 则自动隐藏对应的视角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"></Action>
|
||||
<!--文字弹窗 按钮可以多个 点击事件使用UIClick-->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user