diff --git a/Assets/Art/UIPrefab/UICameraSwitch.prefab b/Assets/Art/UIPrefab/UICameraSwitch.prefab index 92fbe6e1..d287323b 100644 --- a/Assets/Art/UIPrefab/UICameraSwitch.prefab +++ b/Assets/Art/UIPrefab/UICameraSwitch.prefab @@ -17,7 +17,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &3411569463940388114 RectTransform: m_ObjectHideFlags: 0 @@ -226,7 +226,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &7775706862032139777 RectTransform: m_ObjectHideFlags: 0 @@ -826,7 +826,7 @@ MonoBehaviour: onValueChanged: m_PersistentCalls: m_Calls: [] - m_IsOn: 1 + m_IsOn: 0 --- !u!1 &8974889932437628810 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Art/UIPrefab/UIModuleSelect.prefab b/Assets/Art/UIPrefab/UIModuleSelect.prefab index ed20e608..5b3117c6 100644 --- a/Assets/Art/UIPrefab/UIModuleSelect.prefab +++ b/Assets/Art/UIPrefab/UIModuleSelect.prefab @@ -403,7 +403,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -30, y: -30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7870331819941572208 CanvasRenderer: @@ -433,7 +433,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\u6A21\u5757\u540D\u79F0" + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 9bbfb1bdb0251664eb0932e39724900e, type: 2} m_sharedMaterial: {fileID: 5103963756306747964, guid: 9bbfb1bdb0251664eb0932e39724900e, type: 2} diff --git a/Assets/Art/UIPrefab/UIOperation.prefab b/Assets/Art/UIPrefab/UIOperation.prefab deleted file mode 100644 index 8b086233..00000000 --- a/Assets/Art/UIPrefab/UIOperation.prefab +++ /dev/null @@ -1,51 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &3729526601115419663 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3256374369696445859} - - component: {fileID: -9207525245426838971} - m_Layer: 0 - m_Name: UIOperation - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &3256374369696445859 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3729526601115419663} - 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: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &-9207525245426838971 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3729526601115419663} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 148f4b33a3a7f144e969a73ed6f9a095, type: 3} - m_Name: - m_EditorClassIdentifier: diff --git a/Assets/Art/UIPrefab/UIOperation.prefab.meta b/Assets/Art/UIPrefab/UIOperation.prefab.meta deleted file mode 100644 index bc47bdc6..00000000 --- a/Assets/Art/UIPrefab/UIOperation.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f3cf28914a0794b46a2c22d97024387a -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: uioperation_prefab - assetBundleVariant: diff --git a/Assets/Art/UIPrefab/UIOperationList.prefab b/Assets/Art/UIPrefab/UIOperationList.prefab index 004eae42..e387fe22 100644 --- a/Assets/Art/UIPrefab/UIOperationList.prefab +++ b/Assets/Art/UIPrefab/UIOperationList.prefab @@ -763,7 +763,7 @@ MonoBehaviour: m_ScrollSensitivity: 1 m_Viewport: {fileID: 8731652694218410629} m_HorizontalScrollbar: {fileID: 0} - m_VerticalScrollbar: {fileID: 1945366071212582513} + m_VerticalScrollbar: {fileID: 0} m_HorizontalScrollbarVisibility: 2 m_VerticalScrollbarVisibility: 2 m_HorizontalScrollbarSpacing: -3 @@ -1068,7 +1068,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &6772576175566796072 RectTransform: m_ObjectHideFlags: 0 @@ -1248,9 +1248,9 @@ RectTransform: m_Father: {fileID: 2192231524565599668} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -12, y: 0} m_Pivot: {x: 0, y: 1} --- !u!222 &1726614218311108045 CanvasRenderer: @@ -1336,7 +1336,7 @@ RectTransform: m_Father: {fileID: 1644315794790874757} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/Art/UIPrefab/UIRightTop.prefab b/Assets/Art/UIPrefab/UIRightTop.prefab index 887a2420..4e719eef 100644 --- a/Assets/Art/UIPrefab/UIRightTop.prefab +++ b/Assets/Art/UIPrefab/UIRightTop.prefab @@ -429,9 +429,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 2505519175557592291} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} m_SizeDelta: {x: 32, y: 32} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1402148308183576929 @@ -838,7 +838,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &2505519175557592291 RectTransform: m_ObjectHideFlags: 0 @@ -855,10 +855,10 @@ RectTransform: - {fileID: 3064490650672719453} m_Father: {fileID: 906599229421366858} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 583.3438, y: -35.5} + m_SizeDelta: {x: 68, y: 32} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &4014962916602461336 MonoBehaviour: @@ -1507,9 +1507,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 2505519175557592291} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 50, y: -16} m_SizeDelta: {x: 36, y: 18} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7242127381975158959 diff --git a/Assets/Art/UIPrefab/UISetting.prefab b/Assets/Art/UIPrefab/UISetting.prefab index 85d8035d..b8c81173 100644 --- a/Assets/Art/UIPrefab/UISetting.prefab +++ b/Assets/Art/UIPrefab/UISetting.prefab @@ -1690,10 +1690,10 @@ MonoBehaviour: m_FillRect: {fileID: 4260347516208239176} m_HandleRect: {fileID: 8825168004229886871} m_Direction: 0 - m_MinValue: 0.01 + m_MinValue: 0 m_MaxValue: 0.1 m_WholeNumbers: 0 - m_Value: 0.0983 + m_Value: 0.05 m_OnValueChanged: m_PersistentCalls: m_Calls: [] @@ -2088,7 +2088,7 @@ MonoBehaviour: m_MinValue: 0 m_MaxValue: 1 m_WholeNumbers: 0 - m_Value: 0.36 + m_Value: 0.5 m_OnValueChanged: m_PersistentCalls: m_Calls: [] diff --git a/Assets/Art/UIPrefab/UITextTip.prefab b/Assets/Art/UIPrefab/UITextTip.prefab index f68b2cf5..1e66446d 100644 --- a/Assets/Art/UIPrefab/UITextTip.prefab +++ b/Assets/Art/UIPrefab/UITextTip.prefab @@ -378,9 +378,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: ' - -' + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} @@ -519,7 +517,7 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4085354983340029108} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: @@ -907,10 +905,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 + m_Left: 5 + m_Right: 5 + m_Top: 5 + m_Bottom: 5 m_ChildAlignment: 1 m_Spacing: 0 m_ChildForceExpandWidth: 1 diff --git a/Assets/QFramework/Toolkits/AudioKit/Scripts/AudioKitSettings.cs b/Assets/QFramework/Toolkits/AudioKit/Scripts/AudioKitSettings.cs index f3a3de5a..0b03f74a 100644 --- a/Assets/QFramework/Toolkits/AudioKit/Scripts/AudioKitSettings.cs +++ b/Assets/QFramework/Toolkits/AudioKit/Scripts/AudioKitSettings.cs @@ -45,11 +45,11 @@ namespace QFramework } ); - SoundVolume = new PlayerPrefsFloatProperty(KEY_AUDIO_MANAGER_SOUND_VOLUME, 1.0f); + SoundVolume = new PlayerPrefsFloatProperty(KEY_AUDIO_MANAGER_SOUND_VOLUME, 0.5f); - MusicVolume = new PlayerPrefsFloatProperty(KEY_AUDIO_MANAGER_MUSIC_VOLUME, 1.0f); + MusicVolume = new PlayerPrefsFloatProperty(KEY_AUDIO_MANAGER_MUSIC_VOLUME, 0.5f); - VoiceVolume = new PlayerPrefsFloatProperty(KEY_AUDIO_MANAGER_VOICE_VOLUME, 1.0f); + VoiceVolume = new PlayerPrefsFloatProperty(KEY_AUDIO_MANAGER_VOICE_VOLUME, 0.5f); } diff --git a/Assets/Scenes/TestUIPanels/TestUIOperation.unity b/Assets/Scenes/TestUIPanels/TestUIOperation.unity deleted file mode 100644 index 95277af8..00000000 --- a/Assets/Scenes/TestUIPanels/TestUIOperation.unity +++ /dev/null @@ -1,751 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 12 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_ExtractAmbientOcclusion: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVRBounces: 2 - m_PVREnvironmentSampleCount: 256 - m_PVREnvironmentReferencePointCount: 2048 - m_PVRFilteringMode: 1 - m_PVRDenoiserTypeDirect: 1 - m_PVRDenoiserTypeIndirect: 1 - m_PVRDenoiserTypeAO: 1 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVREnvironmentMIS: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_LightingSettings: {fileID: 0} ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - maxJobWorkers: 0 - preserveTilesOutsideBounds: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &139136931 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 139136932} - m_Layer: 5 - m_Name: Bg - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &139136932 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 139136931} - 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: 1312594378} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &580077701 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 580077702} - m_Layer: 5 - m_Name: Common - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &580077702 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 580077701} - 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: 1312594378} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &961676495 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 961676496} - - component: {fileID: 961676497} - m_Layer: 5 - m_Name: Design - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &961676496 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 961676495} - 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: 2309906618182155809} - m_Father: {fileID: 1312594378} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &961676497 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 961676495} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6eba024ea32574239b57b098f1dc6282, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!1 &1312594373 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1312594378} - - component: {fileID: 1312594377} - - component: {fileID: 1312594376} - - component: {fileID: 1312594375} - - component: {fileID: 1312594374} - m_Layer: 5 - m_Name: UIRoot - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1312594374 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1312594373} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d2db7fffd623c478eba3d2cb84034d2f, type: 3} - m_Name: - m_EditorClassIdentifier: - UICamera: {fileID: 1397258137} - Canvas: {fileID: 1312594377} - CanvasScaler: {fileID: 1312594376} - GraphicRaycaster: {fileID: 1312594375} - Bg: {fileID: 139136932} - Common: {fileID: 580077702} - PopUI: {fileID: 1872605580} - CanvasPanel: {fileID: 1586542868} ---- !u!114 &1312594375 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1312594373} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 0 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &1312594376 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1312594373} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 1 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 1920, y: 1080} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0.5 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 0 ---- !u!223 &1312594377 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1312594373} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 1397258137} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 1 - m_SortingLayerID: 0 - m_SortingOrder: 100 - m_TargetDisplay: 0 ---- !u!224 &1312594378 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1312594373} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 139136932} - - {fileID: 580077702} - - {fileID: 1872605580} - - {fileID: 1586542868} - - {fileID: 961676496} - - {fileID: 1765029982} - - {fileID: 1397258139} - - {fileID: 1364952468} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!1 &1364952467 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1364952468} - - component: {fileID: 1364952469} - m_Layer: 5 - m_Name: Manager - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1364952468 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1364952467} - 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: 1312594378} - m_RootOrder: 7 - 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: 0, y: 0} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1364952469 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1364952467} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5dc84f25d84334e168bf64050b91e1fb, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!1 &1397258136 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1397258139} - - component: {fileID: 1397258137} - - component: {fileID: 1397258138} - m_Layer: 5 - m_Name: UICamera - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!20 &1397258137 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1397258136} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 3 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 5 - m_Depth: 99 - m_CullingMask: - serializedVersion: 2 - m_Bits: 32 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 0 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!124 &1397258138 -Behaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1397258136} - m_Enabled: 1 ---- !u!4 &1397258139 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1397258136} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -100} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1312594378} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1586542867 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1586542868} - m_Layer: 5 - m_Name: CanvasPanel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1586542868 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1586542867} - 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: 1312594378} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &1765029981 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1765029982} - - component: {fileID: 1765029984} - - component: {fileID: 1765029983} - m_Layer: 5 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1765029982 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1765029981} - 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: 1312594378} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1765029983 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1765029981} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} - m_Name: - m_EditorClassIdentifier: - m_SendPointerHoverToParent: 1 - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 1 ---- !u!114 &1765029984 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1765029981} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 5 ---- !u!1 &1872605579 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1872605580} - m_Layer: 5 - m_Name: PopUI - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1872605580 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1872605579} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.0000799, y: 1.0000799, z: 1.0000799} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1312594378} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1001 &2309906618182155808 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 961676496} - m_Modifications: - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3729526601115419663, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - propertyPath: m_Name - value: UIOperation - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} ---- !u!224 &2309906618182155809 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 3256374369696445859, guid: f3cf28914a0794b46a2c22d97024387a, type: 3} - m_PrefabInstance: {fileID: 2309906618182155808} - m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scenes/TestUIPanels/TestUIOperation.unity.meta b/Assets/Scenes/TestUIPanels/TestUIOperation.unity.meta deleted file mode 100644 index 72bfb025..00000000 --- a/Assets/Scenes/TestUIPanels/TestUIOperation.unity.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a975291794a505e4d853a3816b49a0ae -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Actions/ActionHelper.cs b/Assets/Scripts/Actions/ActionHelper.cs index a13fb53d..813c31c2 100644 --- a/Assets/Scripts/Actions/ActionHelper.cs +++ b/Assets/Scripts/Actions/ActionHelper.cs @@ -133,6 +133,11 @@ public class ActionHelper var strAction = (XMLTool.DictionaryAction)act; return ShowAction.Allocate(act.Value, strAction.args); } + case "TipWindow": + { + var strAction = (XMLTool.StringListAction)act; + return TipWindowAction.Allocate(act.Value, strAction.args[0], strAction.args[1]); + } case "TextTip": { var strAction = (XMLTool.StringListAction)act; @@ -167,8 +172,8 @@ public class ActionHelper } case "LoadRes": { - var strAction = (XMLTool.StringListAction)act; - return LoadResAction.Allocate(act.Value, strAction.args[0]); + var dictAction = (XMLTool.DictionaryAction)act; + return LoadResAction.Allocate(act.Value, dictAction.args); } case "Audio": { diff --git a/Assets/Scripts/Actions/AnimationAction.cs b/Assets/Scripts/Actions/AnimationAction.cs index 16660014..4cf89710 100644 --- a/Assets/Scripts/Actions/AnimationAction.cs +++ b/Assets/Scripts/Actions/AnimationAction.cs @@ -56,6 +56,10 @@ namespace QFramework } if (obj != null) { + if (obj.activeSelf == false) + { + Debug.LogError(obj.name + "当前是隐藏状态"); + } try { anim = obj.GetComponent(); diff --git a/Assets/Scripts/Actions/LoadResAction.cs b/Assets/Scripts/Actions/LoadResAction.cs index ceaa950e..a164d8c4 100644 --- a/Assets/Scripts/Actions/LoadResAction.cs +++ b/Assets/Scripts/Actions/LoadResAction.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Xml.Linq; using UnityEngine; using XMLTool; @@ -21,14 +22,16 @@ namespace QFramework string fileName; string type; - public static LoadResAction Allocate(string fileName, string type, System.Action OnFinished = null) + string index; + public static LoadResAction Allocate(string fileName, Dictionary datas, System.Action OnFinished = null) { var retNode = mPool.Allocate(); retNode.ActionID = ActionKit.ID_GENERATOR++; retNode.Deinited = false; retNode.Reset(); retNode.fileName = fileName; - retNode.type = type; + retNode.type = datas.ContainsKey("resType") ? datas["resType"] : string.Empty; + retNode.index = datas.ContainsKey("index") ? datas["index"] : string.Empty; retNode.OnFinished = OnFinished; return retNode; } @@ -55,7 +58,15 @@ namespace QFramework XDocument doc = XDocument.Parse(xmlStr); // 获取根元素 XElement moduleXml = doc.Root; - XmlParser.LoadModule(moduleXml, Global.Instance.appData); + if (string.IsNullOrEmpty(index)) + { + // 无序加载 + XmlParser.LoadModule(moduleXml, Global.Instance.appData); + } + else + { + Global.moduleDict.Add(index, moduleXml); + } } } }); diff --git a/Assets/Scripts/Actions/TipWindowAction.cs b/Assets/Scripts/Actions/TipWindowAction.cs new file mode 100644 index 00000000..e7a5540c --- /dev/null +++ b/Assets/Scripts/Actions/TipWindowAction.cs @@ -0,0 +1,69 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using QFramework; +using System; +using QFramework.Example; +using System.Linq; +public class TipWindowAction : IAction +{ + public ulong ActionID { get; set; } + public bool Deinited { get; set; } + public bool Paused { get; set; } + public ActionStatus Status { get; set; } + + private static readonly SimpleObjectPool mPool = + new SimpleObjectPool(() => new TipWindowAction(), null, 10); + string text = string.Empty; + string btns = string.Empty; + string audio = string.Empty; + public static TipWindowAction Allocate(string text, string audio, string btns, System.Action onDelayFinish = null) + { + var retNode = mPool.Allocate(); + retNode.ActionID = ActionKit.ID_GENERATOR++; + retNode.Deinited = false; + retNode.Reset(); + retNode.text = text; + retNode.btns = btns; + retNode.audio = audio; + return retNode; + } + + + + public void Deinit() + { + if (!Deinited) + { + Deinited = true; + mPool.Recycle(this); + } + } + + public void OnExecute(float dt) + { + } + + public void OnFinish() + { + } + + public void OnStart() + { + UITipWindowData data = new UITipWindowData(); + data.txt = text; + var btnText = btns.Split(',').ToList(); + foreach (var item in btnText) + { + data.btns.Add(new UITipWindowData.ItemData() { txt = item }); + } + data.audio = audio; + UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => this.Finish()); + } + + public void Reset() + { + Status = ActionStatus.NotStart; + Paused = false; + } +} diff --git a/Assets/Scripts/UI/UIOperation.Designer.cs.meta b/Assets/Scripts/Actions/TipWindowAction.cs.meta similarity index 83% rename from Assets/Scripts/UI/UIOperation.Designer.cs.meta rename to Assets/Scripts/Actions/TipWindowAction.cs.meta index 8edb8894..c465da72 100644 --- a/Assets/Scripts/UI/UIOperation.Designer.cs.meta +++ b/Assets/Scripts/Actions/TipWindowAction.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 237e46780047f1a42bab78186bcf79cb +guid: 10573b9b3c343214bb0b5990d11f02f5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Conditions/ObjClickCondition.cs b/Assets/Scripts/Conditions/ObjClickCondition.cs index 3dd78de4..68754b2c 100644 --- a/Assets/Scripts/Conditions/ObjClickCondition.cs +++ b/Assets/Scripts/Conditions/ObjClickCondition.cs @@ -45,7 +45,7 @@ namespace QFramework obj = DeviceController.Instance.GetDeviceObj(deviceName); } } - if (obj != null && Input.GetMouseButtonUp(0)) + if (obj != null && Input.GetMouseButtonUp(0) && EventSystem.current.IsPointerOverGameObject() == false) { Vector3 mousePos = Input.mousePosition; Ray ray = Camera.main.ScreenPointToRay(mousePos); diff --git a/Assets/Scripts/Controller/DeviceController.cs b/Assets/Scripts/Controller/DeviceController.cs index 31af88ab..8ff25fd3 100644 --- a/Assets/Scripts/Controller/DeviceController.cs +++ b/Assets/Scripts/Controller/DeviceController.cs @@ -30,7 +30,6 @@ public class DeviceController : MonoSingleton private void OnQuit(OnModuleQuit quit) { deviceDict.Clear(); - deviceDict.Clear(); } private void OnStart(OnModuleStart start) diff --git a/Assets/Scripts/Controller/OperationController.cs b/Assets/Scripts/Controller/OperationController.cs index cbeb9eab..156f24ad 100644 --- a/Assets/Scripts/Controller/OperationController.cs +++ b/Assets/Scripts/Controller/OperationController.cs @@ -46,6 +46,7 @@ public class OperationController : MonoSingleton { Refresh(); }).UnRegisterWhenGameObjectDestroyed(gameObject); + } public void Refresh() @@ -66,18 +67,24 @@ public class OperationController : MonoSingleton } TypeEventSystem.Global.Register(OnExecute); TypeEventSystem.Global.Register(OnNext); - TypeEventSystem.Global.Register(arg => Clear()); + TypeEventSystem.Global.Register(OnModuleQuitHandler); } } } + private void OnModuleQuitHandler(OnModuleQuit quit) + { + Clear(); + } + public void Clear() { + index = -1; curAction.Deinit(); steps.Clear(); - TypeEventSystem.Global.UnRegister(arg => Clear()); + TypeEventSystem.Global.UnRegister(OnModuleQuitHandler); TypeEventSystem.Global.UnRegister(OnExecute); TypeEventSystem.Global.UnRegister(OnNext); diff --git a/Assets/Scripts/Controller/VarController.cs b/Assets/Scripts/Controller/VarController.cs index 48234840..d69ae194 100644 --- a/Assets/Scripts/Controller/VarController.cs +++ b/Assets/Scripts/Controller/VarController.cs @@ -1,4 +1,5 @@ using QFramework; +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -12,9 +13,15 @@ public class VarController : MonoSingleton { base.OnSingletonInit(); varDict = new Dictionary(); + TypeEventSystem.Global.Register(OnQuit).UnRegisterWhenGameObjectDestroyed(gameObject); } + private void OnQuit(OnModuleQuit quit) + { + varDict.Clear(); + } + public void Set(string key, float value) { if (varDict.ContainsKey(key)) diff --git a/Assets/Scripts/Editor/SetReadWrite.cs b/Assets/Scripts/Editor/SetReadWrite.cs new file mode 100644 index 00000000..cb45e4f0 --- /dev/null +++ b/Assets/Scripts/Editor/SetReadWrite.cs @@ -0,0 +1,50 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; + +public class SetReadWrite : Editor +{ + [MenuItem("Assets/FBX ReadWrite Enable %&r")] + public static void EnableFBXReadWrite() + { + Object[] selectedObjects = Selection.GetFiltered(SelectionMode.DeepAssets); + foreach (Object obj in selectedObjects) + { + if (obj != null) + { + string path = AssetDatabase.GetAssetPath(obj); + if (Directory.Exists(path)) + { + EnableFBXReadWriteInFolder(path); + } + else if (path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase)) + { + EnableFBXReadWriteForFile(path); + } + } + } + } + + public static void EnableFBXReadWriteInFolder(string folderPath) + { + string[] files = Directory.GetFiles(folderPath, "*.fbx", SearchOption.AllDirectories); + foreach (string file in files) + { + EnableFBXReadWriteForFile(file); + } + } + + public static void EnableFBXReadWriteForFile(string filePath) + { + string relativePath = filePath; + ModelImporter importer = AssetImporter.GetAtPath(relativePath) as ModelImporter; + if (importer != null) + { + importer.isReadable = true; + AssetDatabase.ImportAsset(relativePath, ImportAssetOptions.ForceUpdate); + Debug.Log("Enabled Read/Write for: " + relativePath); + } + } +} diff --git a/Assets/Scripts/Global/Global.cs b/Assets/Scripts/Global/Global.cs index 339953fd..10063865 100644 --- a/Assets/Scripts/Global/Global.cs +++ b/Assets/Scripts/Global/Global.cs @@ -2,6 +2,7 @@ using QFramework; using System; using System.Collections; using System.Collections.Generic; +using System.Xml.Linq; using UnityEngine; using XMLTool; @@ -35,6 +36,6 @@ public class Global : Singleton public static AppType appTpe = AppType.UnKnow; - + public static Dictionary moduleDict = new Dictionary(); } diff --git a/Assets/Scripts/Launch.cs b/Assets/Scripts/Launch.cs index ed089f65..cfe71e87 100644 --- a/Assets/Scripts/Launch.cs +++ b/Assets/Scripts/Launch.cs @@ -41,7 +41,21 @@ public class Launch : MonoBehaviour yield return new WaitUntil(() => isLoadFinished == true); if (Global.Instance.appData.preLoad != null && Global.Instance.appData.preLoad.action != null) { - yield return ActionHelper.GetActionAndSub(Global.Instance.appData.preLoad.action).Start(this); + yield return ActionHelper.GetActionAndSub(Global.Instance.appData.preLoad.action).Start(this, () => + { + // 暂时放在这里 + if (Global.moduleDict.Count > 0) + { + for (int i = 0; i < Global.moduleDict.Count; i++) + { + string index = (i + 1).ToString(); + if (Global.moduleDict.ContainsKey(index)) + { + XmlParser.LoadModule(Global.moduleDict[index], Global.Instance.appData); + } + } + } + }); } yield return UIKit.OpenPanelAsync(); UIKit.HidePanel(); diff --git a/Assets/Scripts/UI/UIBtns.cs b/Assets/Scripts/UI/UIBtns.cs index d55ca9a4..4b9414ca 100644 --- a/Assets/Scripts/UI/UIBtns.cs +++ b/Assets/Scripts/UI/UIBtns.cs @@ -19,6 +19,7 @@ namespace QFramework.Example mData = uiData as UIBtnsData ?? new UIBtnsData(); // please add init code here TypeEventSystem.Global.Register(OnStepChanged); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) diff --git a/Assets/Scripts/UI/UICameraSwitch.cs b/Assets/Scripts/UI/UICameraSwitch.cs index dd2893cf..4020e826 100644 --- a/Assets/Scripts/UI/UICameraSwitch.cs +++ b/Assets/Scripts/UI/UICameraSwitch.cs @@ -22,6 +22,7 @@ namespace QFramework.Example { protected override void OnInit(IUIData uiData = null) { + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); mData = uiData as UICameraSwitchData ?? new UICameraSwitchData(); // please add init code here Near.onValueChanged.AddListener(isOn => @@ -33,7 +34,7 @@ namespace QFramework.Example Near.transform.Find("Bg/Line").gameObject.SetActive(isOn); }); Far.onValueChanged.AddListener(isOn => - { + { if (isOn) { SetNormal(); @@ -68,6 +69,21 @@ namespace QFramework.Example } } + private void Update() + { +#if UNITY_STANDALONE_WIN + if (Near.isOn == true || Far.isOn == true) + { + if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.D)) + { + Near.isOn = false; + Far.isOn = false; + } + } + +#endif + } + protected override void OnShow() { } diff --git a/Assets/Scripts/UI/UIDeviceTip.cs b/Assets/Scripts/UI/UIDeviceTip.cs index 1724395a..1b94bf72 100644 --- a/Assets/Scripts/UI/UIDeviceTip.cs +++ b/Assets/Scripts/UI/UIDeviceTip.cs @@ -13,6 +13,7 @@ namespace QFramework.Example { mData = uiData as UIDeviceTipData ?? new UIDeviceTipData(); // please add init code here + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } protected override void OnOpen(IUIData uiData = null) diff --git a/Assets/Scripts/UI/UIHint.Designer.cs b/Assets/Scripts/UI/UIHint.Designer.cs index 15ec5a81..b7d0c337 100644 --- a/Assets/Scripts/UI/UIHint.Designer.cs +++ b/Assets/Scripts/UI/UIHint.Designer.cs @@ -5,7 +5,7 @@ using QFramework; namespace QFramework.Example { - // Generate Id:56300545-9a16-4363-94bb-73919dd6d4f0 + // Generate Id:81782f84-21db-40cc-8f07-78023c95d54e public partial class UIHint { public const string Name = "UIHint"; diff --git a/Assets/Scripts/UI/UIHint.cs b/Assets/Scripts/UI/UIHint.cs index b03364bd..6a30db99 100644 --- a/Assets/Scripts/UI/UIHint.cs +++ b/Assets/Scripts/UI/UIHint.cs @@ -17,11 +17,13 @@ namespace QFramework.Example public partial class UIHint : UIPanel { ResLoader loader; + IAction curAction; protected override void OnInit(IUIData uiData = null) { mData = uiData as UIHintData ?? new UIHintData(); SetItem(0); TypeEventSystem.Global.Register(OnStepChanged); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) @@ -31,16 +33,22 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { mData = uiData as UIHintData ?? new UIHintData(); + if (curAction != null) + { + curAction.Deinit(); + curAction = null; + } + Icon.gameObject.SetActive(mData.isShowIcon); Label.text = mData.txt; SetItem(1); if (mData.time != -1) { - ActionKit.Delay(mData.time, () => - { - SetItem(0); - - }).Start(this); + curAction = ActionKit.Delay(mData.time, () => + { + SetItem(0); + }); + curAction.Start(this); } if (string.IsNullOrEmpty(mData.audio) == false) { @@ -61,6 +69,7 @@ namespace QFramework.Example { ItemPrefab.DOFade(alph, 0.5f); Label.DOFade(alph, 0.5f); + Icon.gameObject.SetActive(alph == 1); } protected override void OnShow() diff --git a/Assets/Scripts/UI/UIInstruction.cs b/Assets/Scripts/UI/UIInstruction.cs index 8ba88f6c..aa7d6981 100644 --- a/Assets/Scripts/UI/UIInstruction.cs +++ b/Assets/Scripts/UI/UIInstruction.cs @@ -12,6 +12,7 @@ namespace QFramework.Example { protected override void OnInit(IUIData uiData = null) { + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); mData = uiData as UIInstructionData ?? new UIInstructionData(); // please add init code here Training.onValueChanged.AddListener(isOn => diff --git a/Assets/Scripts/UI/UILoading.cs b/Assets/Scripts/UI/UILoading.cs index e65ab0cd..6d7ed682 100644 --- a/Assets/Scripts/UI/UILoading.cs +++ b/Assets/Scripts/UI/UILoading.cs @@ -14,6 +14,7 @@ namespace QFramework.Example protected override void OnInit(IUIData uiData = null) { mData = uiData as UILoadingData ?? new UILoadingData(); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register(arg => Show()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } diff --git a/Assets/Scripts/UI/UIOperation.Designer.cs b/Assets/Scripts/UI/UIOperation.Designer.cs deleted file mode 100644 index 44186c04..00000000 --- a/Assets/Scripts/UI/UIOperation.Designer.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.UI; -using QFramework; - -namespace QFramework.Example -{ - // Generate Id:3324e284-ff50-4d4b-9da3-440860e54b0d - public partial class UIOperation - { - public const string Name = "UIOperation"; - - - private UIOperationData mPrivateData = null; - - protected override void ClearUIComponents() - { - - mData = null; - } - - public UIOperationData Data - { - get - { - return mData; - } - } - - UIOperationData mData - { - get - { - return mPrivateData ?? (mPrivateData = new UIOperationData()); - } - set - { - mUIData = value; - mPrivateData = value; - } - } - } -} diff --git a/Assets/Scripts/UI/UIOperation.cs b/Assets/Scripts/UI/UIOperation.cs deleted file mode 100644 index 0fc091c2..00000000 --- a/Assets/Scripts/UI/UIOperation.cs +++ /dev/null @@ -1,34 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; -using QFramework; - -namespace QFramework.Example -{ - public class UIOperationData : UIPanelData - { - } - public partial class UIOperation : UIPanel - { - protected override void OnInit(IUIData uiData = null) - { - mData = uiData as UIOperationData ?? new UIOperationData(); - // please add init code here - } - - protected override void OnOpen(IUIData uiData = null) - { - } - - protected override void OnShow() - { - } - - protected override void OnHide() - { - } - - protected override void OnClose() - { - } - } -} diff --git a/Assets/Scripts/UI/UIOperation.cs.meta b/Assets/Scripts/UI/UIOperation.cs.meta deleted file mode 100644 index 15f8a2f1..00000000 --- a/Assets/Scripts/UI/UIOperation.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 148f4b33a3a7f144e969a73ed6f9a095 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/UI/UIOperationList.cs b/Assets/Scripts/UI/UIOperationList.cs index 7e4a9d18..12ab9209 100644 --- a/Assets/Scripts/UI/UIOperationList.cs +++ b/Assets/Scripts/UI/UIOperationList.cs @@ -20,7 +20,7 @@ namespace QFramework.Example protected override void OnInit(IUIData uiData = null) { mData = uiData as UIOperationListData ?? new UIOperationListData(); - TypeEventSystem.Global.Register(OnStepChanged); + TypeEventSystem.Global.Register((arg)=>Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) @@ -67,7 +67,7 @@ namespace QFramework.Example break; case StepStatus.Finished: // TODO:实现方式过于耦合 后期优化 - if (Global.Instance.curModule.type=="Exam") + if (Global.Instance.curModule.type == "Exam") { stepLabel.color = highColor; } @@ -82,6 +82,8 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { + TypeEventSystem.Global.Register(OnStepChanged).UnRegisterWhenDisabled(this); + btns.Clear(); op = OperationController.Instance.operation; StepContent.RemoveAllChildren(); foreach (var item in op.Steps) @@ -138,13 +140,9 @@ namespace QFramework.Example protected override void OnShow() { } - - protected override void OnHide() - { - } - protected override void OnClose() { + TypeEventSystem.Global.UnRegister(OnStepChanged); } } } diff --git a/Assets/Scripts/UI/UIPointQuestion.cs b/Assets/Scripts/UI/UIPointQuestion.cs index cb8ba3e3..8f60f828 100644 --- a/Assets/Scripts/UI/UIPointQuestion.cs +++ b/Assets/Scripts/UI/UIPointQuestion.cs @@ -18,6 +18,7 @@ namespace QFramework.Example mData = uiData as UIPointQuestionData ?? new UIPointQuestionData(); // please add init code here TypeEventSystem.Global.Register(OnStepChanged); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) diff --git a/Assets/Scripts/UI/UIResultTip.cs b/Assets/Scripts/UI/UIResultTip.cs index 8e613038..288574e1 100644 --- a/Assets/Scripts/UI/UIResultTip.cs +++ b/Assets/Scripts/UI/UIResultTip.cs @@ -21,6 +21,7 @@ namespace QFramework.Example Right.gameObject.SetActive(false); Wrong.gameObject.SetActive(false); TypeEventSystem.Global.Register(OnStepChanged); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) diff --git a/Assets/Scripts/UI/UIRightTop.cs b/Assets/Scripts/UI/UIRightTop.cs index c4af2640..af5b0951 100644 --- a/Assets/Scripts/UI/UIRightTop.cs +++ b/Assets/Scripts/UI/UIRightTop.cs @@ -13,8 +13,6 @@ namespace QFramework.Example protected override void OnInit(IUIData uiData = null) { mData = uiData as UIRightTopData ?? new UIRightTopData(); - - setBtn.onClick.AddListener(() => { UIKit.OpenPanelAsync(canvasLevel: UILevel.PopUI).ToAction().StartGlobal(); @@ -23,28 +21,12 @@ namespace QFramework.Example { UITipWindowData data = new UITipWindowData(); data.txt = "是否关闭软件?"; - data.btns.Add(new UITipWindowData.ItemData() { txt = "确定", OnClick = () => Application.Quit() }); - data.btns.Add(new UITipWindowData.ItemData() { txt = "取消" }); - UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(); - }); - - homeBtn.onClick.AddListener(() => - { - UITipWindowData data = new UITipWindowData(); - data.txt = "是否退出当前模块?"; - data.btns.Add(new UITipWindowData.ItemData() - { - txt = "确定", - OnClick = () => - { - Hide(); - TypeEventSystem.Global.Send(); - UIKit.OpenPanelAsync().ToAction().StartGlobal(); - } - }); - data.btns.Add(new UITipWindowData.ItemData() { txt = "取消" }); + data.btns.Add(new UITipWindowData.ItemData() { txt = "是", OnClick = () => Application.Quit() }); + data.btns.Add(new UITipWindowData.ItemData() { txt = "否" }); UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(); }); + backBtn.onClick.AddListener(Home); + homeBtn.onClick.AddListener(Home); desBtn.onClick.AddListener(() => { @@ -57,19 +39,39 @@ namespace QFramework.Example }); } + public void Home() + { + UITipWindowData data = new UITipWindowData(); + data.txt = "是否退出当前模块?"; + data.btns.Add(new UITipWindowData.ItemData() + { + txt = "是", + OnClick = () => + { + Hide(); + TypeEventSystem.Global.Send(); + UIKit.OpenPanelAsync().ToAction().StartGlobal(); + } + }); + data.btns.Add(new UITipWindowData.ItemData() { txt = "否" }); + UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(); + } + protected override void OnOpen(IUIData uiData = null) { Title.text = Global.Instance.curModule.ModuleName; - - switch (Global.Instance.curModule.type) + switch (Global.appTpe) { - case "All": - case "Exam": + case Global.AppType.UnKnow: + break; + case Global.AppType.Study: Score.gameObject.SetActive(true); break; - default: + case Global.AppType.Exam: Score.gameObject.SetActive(false); break; + case Global.AppType.All: + break; } } diff --git a/Assets/Scripts/UI/UIScore.cs b/Assets/Scripts/UI/UIScore.cs index c3995dcd..4856c51e 100644 --- a/Assets/Scripts/UI/UIScore.cs +++ b/Assets/Scripts/UI/UIScore.cs @@ -12,6 +12,7 @@ namespace QFramework.Example protected override void OnInit(IUIData uiData = null) { mData = uiData as UIScoreData ?? new UIScoreData(); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); DownLoad.onClick.AddListener(() => { if (string.IsNullOrEmpty(InputName.text) || string.IsNullOrEmpty(InputId.text)) diff --git a/Assets/Scripts/UI/UISetting.cs b/Assets/Scripts/UI/UISetting.cs index 800525b9..1e4199b8 100644 --- a/Assets/Scripts/UI/UISetting.cs +++ b/Assets/Scripts/UI/UISetting.cs @@ -14,7 +14,6 @@ namespace QFramework.Example { mData = uiData as UISettingData ?? new UISettingData(); - AudioKit.Settings.MusicVolume.RegisterWithInitValue(v => VoiceSlider.value = v).UnRegisterWhenGameObjectDestroyed(this); VoiceSlider.onValueChanged.AddListener(volume => { diff --git a/Assets/Scripts/UI/UITextQuestion.cs b/Assets/Scripts/UI/UITextQuestion.cs index b1e6d874..3069230a 100644 --- a/Assets/Scripts/UI/UITextQuestion.cs +++ b/Assets/Scripts/UI/UITextQuestion.cs @@ -35,6 +35,7 @@ namespace QFramework.Example mData = uiData as UITextQuestionData ?? new UITextQuestionData(); // please add init code here TypeEventSystem.Global.Register(OnStepChanged); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) diff --git a/Assets/Scripts/UI/UITextTip.cs b/Assets/Scripts/UI/UITextTip.cs index b7738738..154c5dec 100644 --- a/Assets/Scripts/UI/UITextTip.cs +++ b/Assets/Scripts/UI/UITextTip.cs @@ -4,6 +4,8 @@ using QFramework; using System.Collections.Generic; using TMPro; using System.Text.RegularExpressions; +using static OperationController; +using System; namespace QFramework.Example { @@ -20,7 +22,14 @@ namespace QFramework.Example { mData = uiData as UITextTipData ?? new UITextTipData(); + TypeEventSystem.Global.Register(OnStepChanged).UnRegisterWhenGameObjectDestroyed(this); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); + } + + private void OnStepChanged(StepStatusOnChange change) + { + Hide(); } protected override void OnOpen(IUIData uiData = null) diff --git a/Assets/Scripts/UI/UITimeTip.cs b/Assets/Scripts/UI/UITimeTip.cs index 9fe6fc39..5cb20689 100644 --- a/Assets/Scripts/UI/UITimeTip.cs +++ b/Assets/Scripts/UI/UITimeTip.cs @@ -36,11 +36,13 @@ namespace QFramework.Example public List sprites; bool isRun = false; List> dotwens = new List>(); + TweenerCore imgTwen; int index = 0; protected override void OnInit(IUIData uiData = null) { mData = uiData as UITimeTipData ?? new UITimeTipData(); // please add init code here + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void Update() @@ -74,18 +76,21 @@ namespace QFramework.Example mData = uiData as UITimeTipData ?? new UITimeTipData(); index = 0; isRun = true; - int endIndex = sprites.Count; + int endIndex = sprites.Count - 1; if (mData.reverse) { index = sprites.Count; endIndex = 0; } - DOTween.To(() => index, v => + imgTwen = DOTween.To(() => index, v => { index = v; Img.sprite = sprites[index]; Img.SetNativeSize(); - }, endIndex, mData.time).SetEase(Ease.Linear).onComplete = () => + + }, endIndex, mData.time); + + imgTwen.SetEase(Ease.Linear).onComplete = () => { if (string.IsNullOrEmpty(mData.finishedEvent) == false) { @@ -129,6 +134,11 @@ namespace QFramework.Example item.Kill(); } dotwens.Clear(); + if (imgTwen != null) + { + imgTwen.Kill(); + imgTwen = null; + } } protected override void OnClose() diff --git a/Assets/Scripts/UI/UITipWindow.cs b/Assets/Scripts/UI/UITipWindow.cs index e4208481..0ed8613c 100644 --- a/Assets/Scripts/UI/UITipWindow.cs +++ b/Assets/Scripts/UI/UITipWindow.cs @@ -16,16 +16,19 @@ namespace QFramework.Example public Action OnClick; } public string txt; + public string audio; public List btns = new List(); } public partial class UITipWindow : UIPanel { + ResLoader loader; protected override void OnInit(IUIData uiData = null) { mData = uiData as UITipWindowData ?? new UITipWindowData(); // please add init code here TypeEventSystem.Global.Register(OnStepChanged); + TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) @@ -44,6 +47,7 @@ namespace QFramework.Example { GameObject obj = GameObject.Instantiate(BtnPrefab.gameObject, BtnContent); obj.transform.Find("Label").GetComponent().text = item.txt; + obj.name = item.txt; obj.GetComponent