Merge branch 'master' into AnHui_BaoShi

This commit is contained in:
shenjianxing 2025-02-07 13:50:58 +08:00
commit c84e3fef84
6 changed files with 36 additions and 10 deletions

View File

@ -465,8 +465,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 131.91986, y: 0} m_AnchoredPosition: {x: 216.55383, y: 0}
m_SizeDelta: {x: 263.8398, y: -752.1277} m_SizeDelta: {x: 433.1077, y: -752.1277}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9008854919363526693 --- !u!222 &9008854919363526693
CanvasRenderer: CanvasRenderer:
@ -725,7 +725,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0} m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1 m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1 m_Maskable: 1
m_OnCullStateChanged: m_OnCullStateChanged:
@ -1274,7 +1274,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1 m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1 m_Maskable: 1
m_OnCullStateChanged: m_OnCullStateChanged:

View File

@ -25,6 +25,7 @@ namespace QFramework
bool isHigh = true; bool isHigh = true;
string deviceName = string.Empty; string deviceName = string.Empty;
string isIndependent; string isIndependent;
string visibility;
public static HighLightAction Allocate(string path, Dictionary<string, string> datas, System.Action OnFinished = null) public static HighLightAction Allocate(string path, Dictionary<string, string> datas, System.Action OnFinished = null)
{ {
var retNode = mPool.Allocate(); var retNode = mPool.Allocate();
@ -45,6 +46,7 @@ namespace QFramework
} }
retNode.deviceName = datas.ContainsKey("deviceName") ? datas["deviceName"] : string.Empty; retNode.deviceName = datas.ContainsKey("deviceName") ? datas["deviceName"] : string.Empty;
retNode.isIndependent = datas.ContainsKey("isIndependent") ? datas["isIndependent"] : string.Empty; retNode.isIndependent = datas.ContainsKey("isIndependent") ? datas["isIndependent"] : string.Empty;
retNode.visibility = datas.ContainsKey("visibility") ? datas["visibility"] : string.Empty;
retNode.OnFinished = OnFinished; retNode.OnFinished = OnFinished;
return retNode; return retNode;
} }
@ -72,6 +74,9 @@ namespace QFramework
var effect = obj.GetOrAddComponent<HighlightEffect>(); var effect = obj.GetOrAddComponent<HighlightEffect>();
effect.outlineColor = color; effect.outlineColor = color;
effect.highlighted = true; effect.highlighted = true;
Visibility visibility = Visibility.Normal;
Enum.TryParse(this.visibility, out visibility);
effect.outlineVisibility = visibility;
obj.GetOrAddComponent<HighLightOnStepChanged>(); obj.GetOrAddComponent<HighLightOnStepChanged>();
if (string.IsNullOrEmpty(isIndependent) == false) if (string.IsNullOrEmpty(isIndependent) == false)
{ {

View File

@ -28,6 +28,7 @@ namespace QFramework
string count; string count;
string time; string time;
string finishedEvent; string finishedEvent;
string visibility;
public static HighLightFlashAction Allocate(string path, Dictionary<string, string> datas, System.Action OnFinished = null) public static HighLightFlashAction Allocate(string path, Dictionary<string, string> datas, System.Action OnFinished = null)
{ {
var retNode = mPool.Allocate(); var retNode = mPool.Allocate();
@ -51,6 +52,7 @@ namespace QFramework
retNode.count = datas.ContainsKey("count") ? datas["count"] : string.Empty; retNode.count = datas.ContainsKey("count") ? datas["count"] : string.Empty;
retNode.time = datas.ContainsKey("time") ? datas["time"] : string.Empty; retNode.time = datas.ContainsKey("time") ? datas["time"] : string.Empty;
retNode.finishedEvent = datas.ContainsKey("finishedEvent") ? datas["finishedEvent"] : string.Empty; retNode.finishedEvent = datas.ContainsKey("finishedEvent") ? datas["finishedEvent"] : string.Empty;
retNode.visibility = datas.ContainsKey("visibility") ? datas["visibility"] : string.Empty;
retNode.OnFinished = OnFinished; retNode.OnFinished = OnFinished;
return retNode; return retNode;
} }
@ -79,6 +81,9 @@ namespace QFramework
var effect = obj.GetOrAddComponent<HighlightEffect>(); var effect = obj.GetOrAddComponent<HighlightEffect>();
effect.outlineColor = color; effect.outlineColor = color;
effect.highlighted = true; effect.highlighted = true;
Visibility visibility = Visibility.Normal;
Enum.TryParse(this.visibility, out visibility);
effect.outlineVisibility = visibility;
obj.GetOrAddComponent<HighLightOnStepChanged>(); obj.GetOrAddComponent<HighLightOnStepChanged>();
if (string.IsNullOrEmpty(isIndependent) == false) if (string.IsNullOrEmpty(isIndependent) == false)
{ {

View File

@ -20,7 +20,7 @@ namespace QFramework.Example
protected override void OnInit(IUIData uiData = null) protected override void OnInit(IUIData uiData = null)
{ {
mData = uiData as UIOperationListData ?? new UIOperationListData(); mData = uiData as UIOperationListData ?? new UIOperationListData();
TypeEventSystem.Global.Register<OnModuleQuit>((arg)=>Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
} }
private void OnStepChanged(StepStatusOnChange change) private void OnStepChanged(StepStatusOnChange change)
@ -100,14 +100,17 @@ namespace QFramework.Example
subContent.gameObject.SetActive(false); subContent.gameObject.SetActive(false);
btn.name = btns.Count.ToString(); btn.name = btns.Count.ToString();
btns.Add(btn); btns.Add(btn);
arrow.gameObject.SetActive(subContent.transform.childCount > 0);
btn.onClick.AddListener(() => btn.onClick.AddListener(() =>
{ {
subContent.SetActive(!subContent.activeSelf); if (subContent.transform.childCount > 0)
{
subContent.SetActive(!subContent.activeSelf);
}
if (op.freeStep) if (op.freeStep)
{ {
if (highIcon.color != highColor) if (highIcon.color != highColor)
{ {
TypeEventSystem.Global.Send<StepExecute>(new StepExecute() { index = int.Parse(btn.name) }); TypeEventSystem.Global.Send<StepExecute>(new StepExecute() { index = int.Parse(btn.name) });
} }
} }

View File

@ -787,6 +787,11 @@ namespace XMLTool
{ {
act.args.Add("isIndependent", isIndependent.Value); act.args.Add("isIndependent", isIndependent.Value);
} }
XAttribute visibility = action.Attribute("visibility");
if (visibility != null)
{
act.args.Add("visibility", visibility.Value);
}
newAction = act; newAction = act;
} }
break; break;
@ -829,6 +834,11 @@ namespace XMLTool
{ {
act.args.Add("finishedEvent", finishedEvent.Value); act.args.Add("finishedEvent", finishedEvent.Value);
} }
XAttribute visibility = action.Attribute("visibility");
if (visibility != null)
{
act.args.Add("visibility", visibility.Value);
}
newAction = act; newAction = act;
} }
break; break;

View File

@ -89,14 +89,17 @@
如果deviceName存在 则不用isDevice 如果deviceName存在 则不用isDevice
--> -->
<Action type="Show" value="SM_QvanChangJing/sence/pPlane1" deviceName="设备名字" isShow="false" isDevice="false"></Action> <Action type="Show" value="SM_QvanChangJing/sence/pPlane1" deviceName="设备名字" isShow="false" isDevice="false"></Action>
<!--设置物体高亮 deviceName可以用于设备名字 value是物体路径 color是rgba isHigh设置是否显示高亮 isIndependent为true 可以避免模型高亮被遮挡--> <!--设置物体高亮 deviceName可以用于设备名字 value是物体路径 color是rgba isHigh设置是否显示高亮 isIndependent为true 可以避免模型高亮被遮挡
<Action type="HighLight" deviceName="设备名字" value="路径" isHigh="true" color="0,255,0,255" isIndependent="true"></Action> visibility: 有三种形式 Normal, AlwaysOnTop,OnlyWhenOccluded
-->
<Action type="HighLight" deviceName="设备名字" value="路径" isHigh="true" color="0,255,0,255" isIndependent="true" visibility="Normal"></Action>
<!--设置物体高亮 deviceName可以用于设备名字 value是物体路径 color是rgba isHigh设置是否显示高亮 isIndependent为true 可以避免模型高亮被遮挡 <!--设置物体高亮 deviceName可以用于设备名字 value是物体路径 color是rgba isHigh设置是否显示高亮 isIndependent为true 可以避免模型高亮被遮挡
time是从不显示到完全显示的时间 time是从不显示到完全显示的时间
count是循环 -1为无限循环需要主动关闭 count是循环 -1为无限循环需要主动关闭
当count不为-1时 可以使用finishedEvent配合strEvent做闪烁结束的监听 当count不为-1时 可以使用finishedEvent配合strEvent做闪烁结束的监听
visibility: 有三种形式 Normal, AlwaysOnTop,OnlyWhenOccluded
--> -->
<Action type="HighLightFlash" deviceName="测试" isHigh="true" color="0,255,0,255" time="1" count="-1" finishedEvent="等待"></Action> <Action type="HighLightFlash" deviceName="测试" isHigh="true" color="0,255,0,255" time="1" count="-1" finishedEvent="等待" visibility="Normal"></Action>
<!--延迟 value是秒--> <!--延迟 value是秒-->
<Action type="Delay" value="2"></Action> <Action type="Delay" value="2"></Action>
<!-- <!--