diff --git a/Assets/Art/UIPrefab/UIBody3D.prefab b/Assets/Art/UIPrefab/UIBody3D.prefab index f17144c9..6287bd20 100644 --- a/Assets/Art/UIPrefab/UIBody3D.prefab +++ b/Assets/Art/UIPrefab/UIBody3D.prefab @@ -13,6 +13,7 @@ GameObject: - component: {fileID: 7471453852252223781} - component: {fileID: 5527555917717545859} - component: {fileID: 7062404923007037839} + - component: {fileID: 382069942731596912} m_Layer: 5 m_Name: HideAll m_TagString: Untagged @@ -35,11 +36,11 @@ RectTransform: - {fileID: 6817573057800099586} m_Father: {fileID: 1062102287437619772} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 50.99994, y: -256} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 0, y: 284} m_SizeDelta: {x: 102, y: 34} - m_Pivot: {x: 0.5, y: 1} + m_Pivot: {x: 0.00000008940697, y: 1} --- !u!222 &4845750367835213768 CanvasRenderer: m_ObjectHideFlags: 0 @@ -142,6 +143,114 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_IsOn: 0 +--- !u!114 &382069942731596912 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 190223477679832053} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4d0390bd8b8ffd640b34fe25065ff1df, type: 3} + m_Name: + m_EditorClassIdentifier: + updateType: 0 + isSpeedBased: 0 + hasOnStart: 0 + hasOnPlay: 0 + hasOnUpdate: 0 + hasOnStepComplete: 0 + hasOnComplete: 0 + hasOnTweenCreated: 0 + hasOnRewind: 0 + onStart: + m_PersistentCalls: + m_Calls: [] + onPlay: + m_PersistentCalls: + m_Calls: [] + onUpdate: + m_PersistentCalls: + m_Calls: [] + onStepComplete: + m_PersistentCalls: + m_Calls: [] + onComplete: + m_PersistentCalls: + m_Calls: [] + onTweenCreated: + m_PersistentCalls: + m_Calls: [] + onRewind: + m_PersistentCalls: + m_Calls: [] + targetIsSelf: 1 + targetGO: {fileID: 0} + tweenTargetIsTargetGO: 1 + delay: 0 + duration: 0.3 + easeType: 12 + easeCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + loopType: 0 + loops: 1 + id: + isRelative: 0 + isFrom: 0 + isIndependentUpdate: 0 + autoKill: 0 + autoGenerate: 1 + isActive: 1 + isValid: 1 + target: {fileID: 4882082439993323191} + animationType: 1 + targetType: 5 + forcedTargetType: 0 + autoPlay: 0 + useTargetAsV3: 0 + endValueFloat: 0 + endValueV3: {x: -120, y: 284, z: 0} + endValueV2: {x: 0, y: 0} + endValueColor: {r: 1, g: 1, b: 1, a: 1} + endValueString: + endValueRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + endValueTransform: {fileID: 0} + optionalBool0: 0 + optionalBool1: 0 + optionalFloat0: 0 + optionalInt0: 0 + optionalRotationMode: 0 + optionalScrambleMode: 0 + optionalShakeRandomnessMode: 0 + optionalString: --- !u!1 &275089594207850377 GameObject: m_ObjectHideFlags: 0 @@ -169,17 +278,17 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 275089594207850377} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4953482758554625882} - m_Father: {fileID: 1062102287437619772} + m_Father: {fileID: 7012541589931891369} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 885, y: 245} + m_AnchoredPosition: {x: 129.72705, y: 245} m_SizeDelta: {x: 160, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7135243213275214859 @@ -1262,12 +1371,12 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3212297805599067200} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1062102287437619772} + m_Father: {fileID: 7012541589931891369} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1618,12 +1727,10 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 5601864313735818432} - - {fileID: 7473498730775191750} - - {fileID: 5813253783596824543} - {fileID: 4882082439993323191} - {fileID: 3644811849542302248} - - {fileID: 4263527001158670657} + - {fileID: 7012541589931891369} + - {fileID: 5813253783596824543} - {fileID: 3238461836348479573} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1644,17 +1751,19 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e84d6d3749854e844b5245f304121259, type: 3} m_Name: m_EditorClassIdentifier: - BodyContent: {fileID: 5601864313735818432} - BodyList: {fileID: 7473498730775191750} - ResetBtn: {fileID: 1164260856681727312} HideAll: {fileID: 7062404923007037839} LeftContent: {fileID: 3644811849542302248} + ResetBtn: {fileID: 1164260856681727312} ActiveBtn: {fileID: 6692543268377793545} ActiveBack: {fileID: 3554365675561402507} DragBtn: {fileID: 4284720363514511568} DragReset: {fileID: 1157567473291114344} DragBack: {fileID: 540967449707403434} + RightContent: {fileID: 7012541589931891369} + BodyContent: {fileID: 5601864313735818432} + BodyList: {fileID: 7473498730775191750} MenuBtn: {fileID: 8217181496106074158} + CloseBtn: {fileID: 3816761972491639292} BodyItem: {fileID: 1682419669064365991} BodyBtn: {fileID: 5694146936101346831} --- !u!1 &4437185578165757201 @@ -2608,7 +2717,7 @@ GameObject: - component: {fileID: 3798647098069220486} - component: {fileID: 3816761972491639292} m_Layer: 5 - m_Name: ResetBtn + m_Name: CloseBtn m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -3076,6 +3185,170 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &7978814967463062048 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7012541589931891369} + - component: {fileID: 889925841178914852} + - component: {fileID: 5269464421851659385} + m_Layer: 0 + m_Name: RightContent + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7012541589931891369 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7978814967463062048} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5601864313735818432} + - {fileID: 7473498730775191750} + - {fileID: 4263527001158670657} + m_Father: {fileID: 1062102287437619772} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 410, y: 1080} + m_Pivot: {x: 1, y: 0.5} +--- !u!114 &889925841178914852 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7978814967463062048} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4d0390bd8b8ffd640b34fe25065ff1df, type: 3} + m_Name: + m_EditorClassIdentifier: + updateType: 0 + isSpeedBased: 0 + hasOnStart: 0 + hasOnPlay: 0 + hasOnUpdate: 0 + hasOnStepComplete: 0 + hasOnComplete: 0 + hasOnTweenCreated: 0 + hasOnRewind: 0 + onStart: + m_PersistentCalls: + m_Calls: [] + onPlay: + m_PersistentCalls: + m_Calls: [] + onUpdate: + m_PersistentCalls: + m_Calls: [] + onStepComplete: + m_PersistentCalls: + m_Calls: [] + onComplete: + m_PersistentCalls: + m_Calls: [] + onTweenCreated: + m_PersistentCalls: + m_Calls: [] + onRewind: + m_PersistentCalls: + m_Calls: [] + targetIsSelf: 1 + targetGO: {fileID: 0} + tweenTargetIsTargetGO: 1 + delay: 0 + duration: 0.3 + easeType: 12 + easeCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + loopType: 0 + loops: 1 + id: + isRelative: 0 + isFrom: 0 + isIndependentUpdate: 0 + autoKill: 0 + autoGenerate: 1 + isActive: 1 + isValid: 1 + target: {fileID: 7012541589931891369} + animationType: 1 + targetType: 5 + forcedTargetType: 0 + autoPlay: 0 + useTargetAsV3: 0 + endValueFloat: 0 + endValueV3: {x: 450, y: 0, z: 0} + endValueV2: {x: 0, y: 0} + endValueColor: {r: 1, g: 1, b: 1, a: 1} + endValueString: + endValueRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + endValueTransform: {fileID: 0} + optionalBool0: 0 + optionalBool1: 0 + optionalFloat0: 0 + optionalInt0: 0 + optionalRotationMode: 0 + optionalScrambleMode: 0 + optionalShakeRandomnessMode: 0 + optionalString: +--- !u!114 &5269464421851659385 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7978814967463062048} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: RightContent + CustomComment: + mComponentName: RectTransform --- !u!1 &8138442986554125957 GameObject: m_ObjectHideFlags: 0 @@ -3101,12 +3374,12 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8138442986554125957} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1062102287437619772} + m_Father: {fileID: 7012541589931891369} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 1} diff --git a/Assets/Art/UIPrefab/UIBody3DMenuTree.prefab b/Assets/Art/UIPrefab/UIBody3DMenuTree.prefab index 3fcc3834..0d027d54 100644 --- a/Assets/Art/UIPrefab/UIBody3DMenuTree.prefab +++ b/Assets/Art/UIPrefab/UIBody3DMenuTree.prefab @@ -960,6 +960,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4f0fcfaf54f5d5f45bad88367fa6cdee, type: 3} m_Name: m_EditorClassIdentifier: + RootContent: {fileID: 2780512865034176281} Input: {fileID: 8717882674060703838} Close: {fileID: 4548797959966114877} Content: {fileID: 230997068583847590} @@ -2228,8 +2229,10 @@ GameObject: m_Component: - component: {fileID: 2780512865034176281} - component: {fileID: 6570752734218630378} + - component: {fileID: 8083432661066997205} + - component: {fileID: 1546129111403102217} m_Layer: 0 - m_Name: Content + m_Name: RootContent m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -2253,9 +2256,9 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: -245.2445, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 490, y: 1080} - m_Pivot: {x: 0.5, y: 0.5} + m_Pivot: {x: 1.0000001, y: 0.5} --- !u!114 &6570752734218630378 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2282,6 +2285,130 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 +--- !u!114 &8083432661066997205 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8197937570590596469} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4d0390bd8b8ffd640b34fe25065ff1df, type: 3} + m_Name: + m_EditorClassIdentifier: + updateType: 0 + isSpeedBased: 0 + hasOnStart: 0 + hasOnPlay: 0 + hasOnUpdate: 0 + hasOnStepComplete: 0 + hasOnComplete: 0 + hasOnTweenCreated: 0 + hasOnRewind: 0 + onStart: + m_PersistentCalls: + m_Calls: [] + onPlay: + m_PersistentCalls: + m_Calls: [] + onUpdate: + m_PersistentCalls: + m_Calls: [] + onStepComplete: + m_PersistentCalls: + m_Calls: [] + onComplete: + m_PersistentCalls: + m_Calls: [] + onTweenCreated: + m_PersistentCalls: + m_Calls: [] + onRewind: + m_PersistentCalls: + m_Calls: [] + targetIsSelf: 1 + targetGO: {fileID: 0} + tweenTargetIsTargetGO: 1 + delay: 0 + duration: 0.3 + easeType: 12 + easeCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + loopType: 0 + loops: 1 + id: + isRelative: 0 + isFrom: 1 + isIndependentUpdate: 0 + autoKill: 0 + autoGenerate: 1 + isActive: 1 + isValid: 1 + target: {fileID: 2780512865034176281} + animationType: 1 + targetType: 5 + forcedTargetType: 0 + autoPlay: 0 + useTargetAsV3: 0 + endValueFloat: 0 + endValueV3: {x: 490, y: 0, z: 0} + endValueV2: {x: 0, y: 0} + endValueColor: {r: 1, g: 1, b: 1, a: 1} + endValueString: + endValueRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + endValueTransform: {fileID: 0} + optionalBool0: 0 + optionalBool1: 0 + optionalFloat0: 0 + optionalInt0: 0 + optionalRotationMode: 0 + optionalScrambleMode: 0 + optionalShakeRandomnessMode: 0 + optionalString: +--- !u!114 &1546129111403102217 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8197937570590596469} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: + CustomComment: + mComponentName: RectTransform --- !u!1 &8216848392191064048 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Editor/OpeanCustomScene.cs b/Assets/Scripts/Editor/OpeanCustomScene.cs index f3557f64..1b216b29 100644 --- a/Assets/Scripts/Editor/OpeanCustomScene.cs +++ b/Assets/Scripts/Editor/OpeanCustomScene.cs @@ -6,7 +6,6 @@ public class OpeanCustomScene : MonoBehaviour [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] private static void Initialize() { - Debug.LogError(FixedMainEditor.isFixedMain); if (FixedMainEditor.isFixedMain) { Scene scene = SceneManager.GetActiveScene(); diff --git a/Assets/Scripts/UI/UIBody3D.Designer.cs b/Assets/Scripts/UI/UIBody3D.Designer.cs index 82c45402..53900293 100644 --- a/Assets/Scripts/UI/UIBody3D.Designer.cs +++ b/Assets/Scripts/UI/UIBody3D.Designer.cs @@ -5,22 +5,18 @@ using QFramework; namespace QFramework.Example { - // Generate Id:b3c99476-8a23-45c1-8eeb-fca6bca1bfda + // Generate Id:c4c99016-4dc4-4883-90dc-580267dd6e5f public partial class UIBody3D { public const string Name = "UIBody3D"; - [SerializeField] - public RectTransform BodyContent; - [SerializeField] - public RectTransform BodyList; - [SerializeField] - public UnityEngine.UI.Button ResetBtn; [SerializeField] public UnityEngine.UI.Toggle HideAll; [SerializeField] public RectTransform LeftContent; [SerializeField] + public UnityEngine.UI.Button ResetBtn; + [SerializeField] public UnityEngine.UI.Toggle ActiveBtn; [SerializeField] public UnityEngine.UI.Button ActiveBack; @@ -31,8 +27,16 @@ namespace QFramework.Example [SerializeField] public UnityEngine.UI.Button DragBack; [SerializeField] + public RectTransform RightContent; + [SerializeField] + public RectTransform BodyContent; + [SerializeField] + public RectTransform BodyList; + [SerializeField] public UnityEngine.UI.Button MenuBtn; [SerializeField] + public UnityEngine.UI.Button CloseBtn; + [SerializeField] public UnityEngine.UI.Toggle BodyItem; [SerializeField] public UnityEngine.UI.Button BodyBtn; @@ -41,17 +45,19 @@ namespace QFramework.Example protected override void ClearUIComponents() { - BodyContent = null; - BodyList = null; - ResetBtn = null; HideAll = null; LeftContent = null; + ResetBtn = null; ActiveBtn = null; ActiveBack = null; DragBtn = null; DragReset = null; DragBack = null; + RightContent = null; + BodyContent = null; + BodyList = null; MenuBtn = null; + CloseBtn = null; BodyItem = null; BodyBtn = null; diff --git a/Assets/Scripts/UI/UIBody3D.cs b/Assets/Scripts/UI/UIBody3D.cs index 0e47958d..1ebd6ff1 100644 --- a/Assets/Scripts/UI/UIBody3D.cs +++ b/Assets/Scripts/UI/UIBody3D.cs @@ -56,6 +56,7 @@ namespace QFramework.Example Dictionary bodyListIndex = new Dictionary(); protected override void OnInit(IUIData uiData = null) { + StringEventSystem.Global.Register("UIBody3DMenuTreeClose", OnShowHandler); DragBtn.onValueChanged.AddListener(isOn => { DragBtn.transform.Find("SubBtns").gameObject.SetActive(isOn); @@ -90,7 +91,7 @@ namespace QFramework.Example MenuBtn.onClick.AddListener(() => { UIKit.OpenPanelAsync(canvasLevel: UILevel.PopUI, new UIBody3DMenuTreeData() { body = mData.body }).ToAction().StartGlobal(); - Hide(); + HideSelf(true); }); DragReset.onClick.AddListener(() => { @@ -109,18 +110,41 @@ namespace QFramework.Example if (isOn) { LeftContent.GetComponent().DORestart(); + RightContent.GetComponent().DORestart(); HideAll.transform.Find("Label").GetComponent().text = "ÏÔʾ"; } else { LeftContent.GetComponent().DOPlayBackwards(); + RightContent.GetComponent().DOPlayBackwards(); HideAll.transform.Find("Label").GetComponent().text = "Òþ²Ø"; } + CloseBtn.gameObject.SetActive(!isOn); }); } + private void OnShowHandler() + { + HideSelf(false); + } + + public void HideSelf(bool isTrue) + { + if (isTrue) + { + + HideAll.GetComponent().DORestart(); + } + else + { + HideAll.GetComponent().DOPlayBackwards(); + } + HideAll.isOn = isTrue; + CloseBtn.gameObject.SetActive(!isTrue); + } + protected override void OnOpen(IUIData uiData = null) { if (uiData != null) @@ -200,6 +224,7 @@ namespace QFramework.Example protected override void OnClose() { + StringEventSystem.Global.UnRegister("UIBody3DMenuTreeClose", OnShowHandler); } } } diff --git a/Assets/Scripts/UI/UIBody3DMenuTree.Designer.cs b/Assets/Scripts/UI/UIBody3DMenuTree.Designer.cs index bb2ec088..e3250563 100644 --- a/Assets/Scripts/UI/UIBody3DMenuTree.Designer.cs +++ b/Assets/Scripts/UI/UIBody3DMenuTree.Designer.cs @@ -5,11 +5,13 @@ using QFramework; namespace QFramework.Example { - // Generate Id:da8f8310-d647-404d-b0c3-d738c239377d + // Generate Id:24c31af0-620b-42d1-8162-cb3554b3f434 public partial class UIBody3DMenuTree { public const string Name = "UIBody3DMenuTree"; + [SerializeField] + public RectTransform RootContent; [SerializeField] public TMPro.TMP_InputField Input; [SerializeField] @@ -27,6 +29,7 @@ namespace QFramework.Example protected override void ClearUIComponents() { + RootContent = null; Input = null; Close = null; Content = null; diff --git a/Assets/Scripts/UI/UIBody3DMenuTree.cs b/Assets/Scripts/UI/UIBody3DMenuTree.cs index 64035885..04210b37 100644 --- a/Assets/Scripts/UI/UIBody3DMenuTree.cs +++ b/Assets/Scripts/UI/UIBody3DMenuTree.cs @@ -4,6 +4,7 @@ using XMLTool; using System.Collections.Generic; using TMPro; using UnityEditor.Hardware; +using DG.Tweening; namespace QFramework.Example { @@ -201,13 +202,15 @@ namespace QFramework.Example Half, Full } + DOTweenAnimation contentAnim; protected override void OnInit(IUIData uiData = null) { + contentAnim = RootContent.GetComponent(); // please add init code here Close.onClick.AddListener(() => { Hide(); - UIKit.OpenPanelAsync().ToAction().StartGlobal(); + StringEventSystem.Global.Send("UIBody3DMenuTreeClose"); }); Input.onSelect.AddListener(str => { @@ -236,6 +239,7 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { mData = uiData as UIBody3DMenuTreeData ?? new UIBody3DMenuTreeData(); + contentAnim.DORestart(); Content.RemoveAllChildren(); objBtnDataMap.Clear(); BuildTreeUI(mData.body); @@ -377,9 +381,33 @@ namespace QFramework.Example protected override void OnShow() { } + public override void Hide() + { + if (contentAnim.onComplete == null) + { + contentAnim.onComplete = new UnityEngine.Events.UnityEvent(); + } + contentAnim.onComplete.RemoveAllListeners(); + contentAnim.DOPlayBackwards(); + contentAnim.onComplete.AddListener(() => + { + base.Hide(); + }); + } protected override void OnHide() { + + //if (contentAnim.onComplete == null) + //{ + // contentAnim.onComplete = new UnityEngine.Events.UnityEvent(); + //} + //contentAnim.onComplete.RemoveAllListeners(); + //contentAnim.DOPlayBackwards(); + //contentAnim.onComplete.AddListener(() => + //{ + // base.OnHide(); + //}); } protected override void OnClose()