添加操作步骤

This commit is contained in:
YangHua 2024-08-26 15:53:36 +08:00
parent fe3c3f9157
commit 7a683b707d
4 changed files with 34 additions and 15 deletions

Binary file not shown.

View File

@ -2835,7 +2835,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
triggerID: 0 triggerID: 0
triggerName: triggerName: "\u68C0\u67E5\u63A5\u7EBF"
_highlight: {fileID: 0} _highlight: {fileID: 0}
isChecked: 0 isChecked: 0
--- !u!1 &991594635 --- !u!1 &991594635
@ -5604,6 +5604,10 @@ PrefabInstance:
propertyPath: triggerName propertyPath: triggerName
value: "\u7535\u80FD\u8868\u5C01\u53702" value: "\u7535\u80FD\u8868\u5C01\u53702"
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2576541079921355268, guid: 10f4454f32eb20e4298912d896f6020e, type: 3}
propertyPath: triggerName
value: "\u7535\u80FD\u8868\u94ED\u724C"
objectReference: {fileID: 0}
- target: {fileID: 2576541080106509928, guid: 10f4454f32eb20e4298912d896f6020e, type: 3} - target: {fileID: 2576541080106509928, guid: 10f4454f32eb20e4298912d896f6020e, type: 3}
propertyPath: hasElectricity propertyPath: hasElectricity
value: 1 value: 1
@ -6644,6 +6648,18 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 543450652271447145} m_TransformParent: {fileID: 543450652271447145}
m_Modifications: m_Modifications:
- target: {fileID: 5948617165021199511, guid: c80ccdb516dbab94083bd57fa1650eda, type: 3}
propertyPath: triggerName
value: "in\u5F00\u5173_\u87BA\u4E1D1"
objectReference: {fileID: 0}
- target: {fileID: 5948617165317844720, guid: c80ccdb516dbab94083bd57fa1650eda, type: 3}
propertyPath: triggerName
value: "in\u5F00\u5173_\u87BA\u4E1D2"
objectReference: {fileID: 0}
- target: {fileID: 5948617165317844723, guid: c80ccdb516dbab94083bd57fa1650eda, type: 3}
propertyPath: triggerName
value: "in\u5F00\u5173_\u87BA\u4E1D3"
objectReference: {fileID: 0}
- target: {fileID: 6126868798989584877, guid: c80ccdb516dbab94083bd57fa1650eda, type: 3} - target: {fileID: 6126868798989584877, guid: c80ccdb516dbab94083bd57fa1650eda, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 1 value: 1

View File

@ -18,26 +18,29 @@ public class Device_Switch : Device_Base
/// <param name="actionBack"></param> /// <param name="actionBack"></param>
public void AddAction(Action<bool> actionBack) public void AddAction(Action<bool> actionBack)
{ {
this.actionBack= actionBack; this.actionBack = actionBack;
} }
private void OnMouseDown() private void OnMouseDown()
{ {
if(isOpen) if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)) == 0)
{ {
isOpen = false; if (isOpen)
transform.localEulerAngles = new Vector3(0, 45, 0); {
} isOpen = false;
else transform.localEulerAngles = new Vector3(0, 45, 0);
{ }
isOpen = true; else
transform.localEulerAngles = new Vector3(0, 0, 0); {
} isOpen = true;
transform.localEulerAngles = new Vector3(0, 0, 0);
}
//调用自定义事件 //µ÷ÓÃ×Ô¶¨Òåʼþ
if (actionBack != null) if (actionBack != null)
{ {
actionBack.Invoke(isOpen); actionBack.Invoke(isOpen);
}
} }
} }