Merge branch 'master' into LouDi_Quan
This commit is contained in:
commit
13e20b36c4
@ -157,8 +157,8 @@ public class ActionHelper
|
|||||||
}
|
}
|
||||||
case "CameraLock":
|
case "CameraLock":
|
||||||
{
|
{
|
||||||
var strAction = (XMLTool.StringListAction)act;
|
var strAction = (XMLTool.DictionaryAction)act;
|
||||||
return CameraLockAction.Allocate(strAction.args[0], strAction.args[1]);
|
return CameraLockAction.Allocate(strAction.args);
|
||||||
}
|
}
|
||||||
case "Video":
|
case "Video":
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace QFramework
|
namespace QFramework
|
||||||
@ -18,14 +19,14 @@ namespace QFramework
|
|||||||
new SimpleObjectPool<CameraLockAction>(() => new CameraLockAction(), null, 10);
|
new SimpleObjectPool<CameraLockAction>(() => new CameraLockAction(), null, 10);
|
||||||
string isMove;
|
string isMove;
|
||||||
string isRotate;
|
string isRotate;
|
||||||
public static CameraLockAction Allocate(string isMove, string isRotate, System.Action OnFinished = null)
|
public static CameraLockAction Allocate(Dictionary<string, string> datas, System.Action OnFinished = null)
|
||||||
{
|
{
|
||||||
var retNode = mPool.Allocate();
|
var retNode = mPool.Allocate();
|
||||||
retNode.ActionID = ActionKit.ID_GENERATOR++;
|
retNode.ActionID = ActionKit.ID_GENERATOR++;
|
||||||
retNode.Deinited = false;
|
retNode.Deinited = false;
|
||||||
retNode.Reset();
|
retNode.Reset();
|
||||||
retNode.isMove = isMove;
|
retNode.isMove = datas.ContainsKey("isMove") ? datas["isMove"] : "true";
|
||||||
retNode.isRotate = isRotate;
|
retNode.isRotate = datas.ContainsKey("isRotate") ? datas["isRotate"] : "true";
|
||||||
retNode.OnFinished = OnFinished;
|
retNode.OnFinished = OnFinished;
|
||||||
return retNode;
|
return retNode;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,10 @@ namespace QFramework
|
|||||||
data.normalPos = Utility.GetVector3FromStrArray(datas["normalPos"]);
|
data.normalPos = Utility.GetVector3FromStrArray(datas["normalPos"]);
|
||||||
data.normalRot = Utility.GetVector3FromStrArray(datas["normalRot"]);
|
data.normalRot = Utility.GetVector3FromStrArray(datas["normalRot"]);
|
||||||
}
|
}
|
||||||
|
if (datas.ContainsKey("isOn"))
|
||||||
|
{
|
||||||
|
data.isOn = datas["isOn"];
|
||||||
|
}
|
||||||
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);
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,10 @@ public class DeviceItem : MonoBehaviour
|
|||||||
{
|
{
|
||||||
bool isActive = true;
|
bool isActive = true;
|
||||||
bool.TryParse(obj[0], out isActive);
|
bool.TryParse(obj[0], out isActive);
|
||||||
gameObject.GetComponent<HighlightTrigger>().enabled = isActive;
|
if (obj.Length == 1 || (obj.Length > 1 && obj[1] == device.Name))
|
||||||
|
{
|
||||||
|
gameObject.GetComponent<HighlightTrigger>().enabled = isActive;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
mData = uiData as UIBtnsData ?? new UIBtnsData();
|
mData = uiData as UIBtnsData ?? new UIBtnsData();
|
||||||
// please add init code here
|
// please add init code here
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,6 +28,7 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
mData = uiData as UIBtnsData ?? new UIBtnsData();
|
mData = uiData as UIBtnsData ?? new UIBtnsData();
|
||||||
BtnContent.RemoveAllChildren();
|
BtnContent.RemoveAllChildren();
|
||||||
foreach (var item in mData.btns)
|
foreach (var item in mData.btns)
|
||||||
|
|||||||
@ -16,6 +16,7 @@ namespace QFramework.Example
|
|||||||
public Vector3 normalRot;
|
public Vector3 normalRot;
|
||||||
public float nearTime;
|
public float nearTime;
|
||||||
public float normalTime;
|
public float normalTime;
|
||||||
|
public string isOn;
|
||||||
|
|
||||||
}
|
}
|
||||||
public partial class UICameraSwitch : UIPanel
|
public partial class UICameraSwitch : UIPanel
|
||||||
@ -58,14 +59,28 @@ namespace QFramework.Example
|
|||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
mData = uiData as UICameraSwitchData ?? new UICameraSwitchData();
|
mData = uiData as UICameraSwitchData ?? new UICameraSwitchData();
|
||||||
|
if (string.IsNullOrEmpty(mData.isOn))
|
||||||
if (Near.isOn)
|
|
||||||
{
|
{
|
||||||
SetNear();
|
if (Near.isOn)
|
||||||
|
{
|
||||||
|
SetNear();
|
||||||
|
}
|
||||||
|
if (Far.isOn)
|
||||||
|
{
|
||||||
|
SetNormal();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Far.isOn)
|
else
|
||||||
{
|
{
|
||||||
SetNormal();
|
switch (mData.isOn)
|
||||||
|
{
|
||||||
|
case "near":
|
||||||
|
SetNear();
|
||||||
|
break;
|
||||||
|
case "normal":
|
||||||
|
SetNormal();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,6 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
mData = uiData as UIHintData ?? new UIHintData();
|
mData = uiData as UIHintData ?? new UIHintData();
|
||||||
SetItem(0);
|
SetItem(0);
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,6 +31,7 @@ namespace QFramework.Example
|
|||||||
}
|
}
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
mData = uiData as UIHintData ?? new UIHintData();
|
mData = uiData as UIHintData ?? new UIHintData();
|
||||||
if (curAction != null)
|
if (curAction != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -142,7 +142,6 @@ namespace QFramework.Example
|
|||||||
}
|
}
|
||||||
protected override void OnClose()
|
protected override void OnClose()
|
||||||
{
|
{
|
||||||
TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,6 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
mData = uiData as UIPointQuestionData ?? new UIPointQuestionData();
|
mData = uiData as UIPointQuestionData ?? new UIPointQuestionData();
|
||||||
// please add init code here
|
// please add init code here
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,6 +27,7 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
mData = uiData as UIPointQuestionData ?? new UIPointQuestionData();
|
mData = uiData as UIPointQuestionData ?? new UIPointQuestionData();
|
||||||
|
|
||||||
Content.RemoveAllChildren();
|
Content.RemoveAllChildren();
|
||||||
|
|||||||
@ -20,7 +20,6 @@ namespace QFramework.Example
|
|||||||
mData = uiData as UIResultTipData ?? new UIResultTipData();
|
mData = uiData as UIResultTipData ?? new UIResultTipData();
|
||||||
Right.gameObject.SetActive(false);
|
Right.gameObject.SetActive(false);
|
||||||
Wrong.gameObject.SetActive(false);
|
Wrong.gameObject.SetActive(false);
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,6 +29,7 @@ namespace QFramework.Example
|
|||||||
}
|
}
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
Right.gameObject.SetActive(false);
|
Right.gameObject.SetActive(false);
|
||||||
Wrong.gameObject.SetActive(false);
|
Wrong.gameObject.SetActive(false);
|
||||||
mData = uiData as UIResultTipData ?? new UIResultTipData();
|
mData = uiData as UIResultTipData ?? new UIResultTipData();
|
||||||
|
|||||||
@ -34,7 +34,6 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
mData = uiData as UITextQuestionData ?? new UITextQuestionData();
|
mData = uiData as UITextQuestionData ?? new UITextQuestionData();
|
||||||
// please add init code here
|
// please add init code here
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,6 +43,7 @@ namespace QFramework.Example
|
|||||||
}
|
}
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
mData = uiData as UITextQuestionData ?? new UITextQuestionData();
|
mData = uiData as UITextQuestionData ?? new UITextQuestionData();
|
||||||
Title.text = mData.title;
|
Title.text = mData.title;
|
||||||
OptionContent.transform.RemoveAllChildren();
|
OptionContent.transform.RemoveAllChildren();
|
||||||
|
|||||||
@ -22,8 +22,6 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
mData = uiData as UITextTipData ?? new UITextTipData();
|
mData = uiData as UITextTipData ?? new UITextTipData();
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenGameObjectDestroyed(this);
|
|
||||||
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,6 +32,7 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
mData = uiData as UITextTipData ?? new UITextTipData();
|
mData = uiData as UITextTipData ?? new UITextTipData();
|
||||||
Des.text = Regex.Replace(mData.text, @"\\n", "\n");
|
Des.text = Regex.Replace(mData.text, @"\\n", "\n");
|
||||||
BtnContent.RemoveAllChildren();
|
BtnContent.RemoveAllChildren();
|
||||||
|
|||||||
@ -27,7 +27,6 @@ namespace QFramework.Example
|
|||||||
mData = uiData as UITipWindowData ?? new UITipWindowData();
|
mData = uiData as UITipWindowData ?? new UITipWindowData();
|
||||||
// please add init code here
|
// please add init code here
|
||||||
|
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,6 +38,7 @@ namespace QFramework.Example
|
|||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
mData = uiData as UITipWindowData ?? new UITipWindowData();
|
mData = uiData as UITipWindowData ?? new UITipWindowData();
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
Label.text = mData.txt;
|
Label.text = mData.txt;
|
||||||
BtnContent.RemoveAllChildren();
|
BtnContent.RemoveAllChildren();
|
||||||
if (mData != null)
|
if (mData != null)
|
||||||
|
|||||||
@ -30,7 +30,6 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
mData = uiData as UIToolsData ?? new UIToolsData();
|
mData = uiData as UIToolsData ?? new UIToolsData();
|
||||||
// please add init code here
|
// please add init code here
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuit).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuit).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +40,7 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
mResLoader = ResLoader.Allocate();
|
mResLoader = ResLoader.Allocate();
|
||||||
mData = uiData as UIToolsData ?? new UIToolsData();
|
mData = uiData as UIToolsData ?? new UIToolsData();
|
||||||
if (string.IsNullOrEmpty(mData.answer) == false)
|
if (string.IsNullOrEmpty(mData.answer) == false)
|
||||||
|
|||||||
@ -666,29 +666,26 @@ namespace XMLTool
|
|||||||
{
|
{
|
||||||
act.args.Add("normalTime", "0");
|
act.args.Add("normalTime", "0");
|
||||||
}
|
}
|
||||||
|
XAttribute isOn = action.Attribute("isOn");
|
||||||
|
if (isOn != null)
|
||||||
|
{
|
||||||
|
act.args.Add("isOn", isOn.Value);
|
||||||
|
}
|
||||||
newAction = act;
|
newAction = act;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "CameraLock":
|
case "CameraLock":
|
||||||
{
|
{
|
||||||
var act = new StringListAction();
|
var act = new DictionaryAction();
|
||||||
XAttribute isMove = action.Attribute("isMove");
|
XAttribute isMove = action.Attribute("isMove");
|
||||||
if (isMove != null)
|
if (isMove != null)
|
||||||
{
|
{
|
||||||
act.args.Add(isMove.Value);
|
act.args.Add("isMove", isMove.Value);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
act.args.Add("true");
|
|
||||||
}
|
}
|
||||||
XAttribute isRotate = action.Attribute("isRotate");
|
XAttribute isRotate = action.Attribute("isRotate");
|
||||||
if (isRotate != null)
|
if (isRotate != null)
|
||||||
{
|
{
|
||||||
act.args.Add(isRotate.Value);
|
act.args.Add("isRotate", isRotate.Value);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
act.args.Add("true");
|
|
||||||
}
|
}
|
||||||
newAction = act;
|
newAction = act;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,8 +51,9 @@
|
|||||||
<Action type="SetScore" name="步骤名字" value="1"></Action>
|
<Action type="SetScore" name="步骤名字" value="1"></Action>
|
||||||
<!--镜头切换 近距离和默认 如果有了nearDevice就可以不用nearPos和nearRot了 按照device的坐标和旋转来处理镜头 normalDevice同理
|
<!--镜头切换 近距离和默认 如果有了nearDevice就可以不用nearPos和nearRot了 按照device的坐标和旋转来处理镜头 normalDevice同理
|
||||||
只设置坐标 不执行镜头切换 是否执行要根据UI的按钮操作来
|
只设置坐标 不执行镜头切换 是否执行要根据UI的按钮操作来
|
||||||
|
isOn: near或者normal 作为强制选择一个镜头
|
||||||
-->
|
-->
|
||||||
<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>
|
<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" isOn="near"></Action>
|
||||||
<!--文字弹窗 按钮可以多个 点击事件使用UIClick-->
|
<!--文字弹窗 按钮可以多个 点击事件使用UIClick-->
|
||||||
<Action type="TextTip" value="这里是文字描述" audio="q001.mp3" btns="确定,取消"/>
|
<Action type="TextTip" value="这里是文字描述" audio="q001.mp3" btns="确定,取消"/>
|
||||||
<!--锁定镜头 true为开启 false为锁定 isMove是移动镜头 isRotate是旋转镜头-->
|
<!--锁定镜头 true为开启 false为锁定 isMove是移动镜头 isRotate是旋转镜头-->
|
||||||
@ -128,7 +129,7 @@
|
|||||||
|
|
||||||
<!--通用事件通知
|
<!--通用事件通知
|
||||||
|
|
||||||
HighLightTrigger:value=false 关闭device悬浮高亮 value=true 开启
|
HighLightTrigger:value=false 关闭device悬浮高亮 value=true 开启 false value=false,deviceName 后面的参数是可以写设备名字 不写就是全部设备
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<Action type="StrEvent" name="HighLightTrigger" value="false"></Action>
|
<Action type="StrEvent" name="HighLightTrigger" value="false"></Action>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user