From 2493cd8520c50db11bc91315535c10d7b29b3807 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 13 Nov 2024 13:55:36 +0800 Subject: [PATCH 01/14] =?UTF-8?q?Rom=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Resources/UIPrefabs/OverlayUI.meta | 8 + .../UIPrefabs/OverlayUI/InputUI.prefab | 450 ++++++++++++++++++ .../UIPrefabs/OverlayUI/InputUI.prefab.meta | 7 + .../UIPrefabs/OverlayUI/Overlay.prefab | 165 +++++++ .../UIPrefabs/OverlayUI/Overlay.prefab.meta | 7 + .../Assets/Scene/AxibugEmuOnline.Client.unity | 113 ++++- .../Assets/Script/Manager/HttpAPI.cs | 19 + .../Assets/Script/Manager/RomLib/RomLib.cs | 49 +- .../UI/CommandDispatcher/CommandExcuter.cs | 5 + .../Script/UI/GamesUI/RomListMenuItem.cs | 82 +++- .../Assets/Script/UI/MenuItem.cs | 14 +- .../Assets/Script/UI/OptionUI/OptionUI.cs | 20 +- .../Assets/Script/UI/OverlayUI.meta | 8 + .../Assets/Script/UI/OverlayUI/InputUI.cs | 54 +++ .../Script/UI/OverlayUI/InputUI.cs.meta | 11 + .../Script/UI/OverlayUI/OverlayManager.cs | 27 ++ .../UI/OverlayUI/OverlayManager.cs.meta | 11 + .../Assets/Script/UI/OverlayUI/OverlayUI.cs | 58 +++ .../Script/UI/OverlayUI/OverlayUI.cs.meta | 11 + .../Assets/Script/UI/SubMenuItemGroup.cs | 4 +- 20 files changed, 1091 insertions(+), 32 deletions(-) create mode 100644 AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI.meta create mode 100644 AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/InputUI.prefab create mode 100644 AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/InputUI.prefab.meta create mode 100644 AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/Overlay.prefab create mode 100644 AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/Overlay.prefab.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI.meta b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI.meta new file mode 100644 index 0000000..c838e80 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae66a82f4821b1d4b8f77eb95a659c23 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/InputUI.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/InputUI.prefab new file mode 100644 index 0000000..344c61a --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/InputUI.prefab @@ -0,0 +1,450 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &653882822709289751 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5589934240202962389} + - component: {fileID: 3486608270429142847} + - component: {fileID: 1398156440816191940} + m_Layer: 5 + m_Name: Placeholder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5589934240202962389 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 653882822709289751} + 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_Children: [] + m_Father: {fileID: 5544196017830799039} + 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.5} + m_SizeDelta: {x: -20, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3486608270429142847 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 653882822709289751} + m_CullTransparentMesh: 1 +--- !u!114 &1398156440816191940 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 653882822709289751} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 75 + m_FontStyle: 2 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 100 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Enter text... +--- !u!1 &3197032368305979763 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3638738785586139655} + - component: {fileID: 6120137949945203901} + - component: {fileID: 7765357008554011675} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3638738785586139655 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3197032368305979763} + 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_Children: [] + m_Father: {fileID: 5544196017830799039} + 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.5} + m_SizeDelta: {x: -20, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6120137949945203901 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3197032368305979763} + m_CullTransparentMesh: 1 +--- !u!114 &7765357008554011675 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3197032368305979763} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 75 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 100 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: +--- !u!1 &4732986731625205737 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5544196017830799039} + - component: {fileID: 7636621933174253281} + - component: {fileID: 4751957965008653128} + - component: {fileID: 2842545688870835167} + m_Layer: 5 + m_Name: InputField + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5544196017830799039 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4732986731625205737} + 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_Children: + - {fileID: 5589934240202962389} + - {fileID: 3638738785586139655} + m_Father: {fileID: 7458324991124475286} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -200, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7636621933174253281 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4732986731625205737} + m_CullTransparentMesh: 1 +--- !u!114 &4751957965008653128 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4732986731625205737} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &2842545688870835167 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4732986731625205737} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 4 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4751957965008653128} + m_TextComponent: {fileID: 7765357008554011675} + m_Placeholder: {fileID: 1398156440816191940} + m_ContentType: 0 + m_InputType: 0 + m_AsteriskChar: 42 + m_KeyboardType: 0 + m_LineType: 0 + m_HideMobileInput: 0 + m_CharacterValidation: 0 + m_CharacterLimit: 0 + m_OnEndEdit: + m_PersistentCalls: + m_Calls: [] + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_CustomCaretColor: 0 + m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} + m_Text: + m_CaretBlinkRate: 0.85 + m_CaretWidth: 1 + m_ReadOnly: 0 + m_ShouldActivateOnSelect: 1 +--- !u!1 &5812039901955765352 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7458324991124475286} + - component: {fileID: 1811275770296273178} + - component: {fileID: 6422235873759818477} + - component: {fileID: 5841450604621234090} + m_Layer: 5 + m_Name: Root + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7458324991124475286 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5812039901955765352} + 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_Children: + - {fileID: 5544196017830799039} + m_Father: {fileID: 5891255890837614045} + 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!225 &1811275770296273178 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5812039901955765352} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!222 &6422235873759818477 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5812039901955765352} + m_CullTransparentMesh: 1 +--- !u!114 &5841450604621234090 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5812039901955765352} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5891255890837614044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5891255890837614045} + - component: {fileID: 5891255890837614042} + m_Layer: 5 + m_Name: InputUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5891255890837614045 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5891255890837614044} + 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_Children: + - {fileID: 7458324991124475286} + 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 &5891255890837614042 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5891255890837614044} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d366ee5eba9505c4ca908df5cfb35585, type: 3} + m_Name: + m_EditorClassIdentifier: + PulseInvoke_Delay: 0.4 + PulseInvoke_Interval: 0.05 + StartAlpha: 0 + StartScale: 1.2 + Duration: 0.5 + Ease: 12 + m_root: {fileID: 7458324991124475286} + m_cg: {fileID: 1811275770296273178} + m_input: {fileID: 2842545688870835167} diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/InputUI.prefab.meta b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/InputUI.prefab.meta new file mode 100644 index 0000000..fd67cf0 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/InputUI.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 179ef233a0b40a74f8df0748c664b5e8 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/Overlay.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/Overlay.prefab new file mode 100644 index 0000000..b34362c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/Overlay.prefab @@ -0,0 +1,165 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3531919739338806916 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3531919739338806919} + - component: {fileID: 3531919739338806918} + m_Layer: 5 + m_Name: Overlay + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3531919739338806919 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3531919739338806916} + 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_Children: + - {fileID: 3531919739979819162} + 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 &3531919739338806918 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3531919739338806916} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 83ac6a2a0673d154cb98c7cc45663eb5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_InputUI: {fileID: 3531919739979819165} +--- !u!1001 &6972157500961473863 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 3531919739338806919} + m_Modifications: + - target: {fileID: 5891255890837614044, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_Name + value: InputUI + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} +--- !u!224 &3531919739979819162 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 5891255890837614045, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + m_PrefabInstance: {fileID: 6972157500961473863} + m_PrefabAsset: {fileID: 0} +--- !u!114 &3531919739979819165 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5891255890837614042, guid: 179ef233a0b40a74f8df0748c664b5e8, type: 3} + m_PrefabInstance: {fileID: 6972157500961473863} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d366ee5eba9505c4ca908df5cfb35585, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/Overlay.prefab.meta b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/Overlay.prefab.meta new file mode 100644 index 0000000..fadfc43 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OverlayUI/Overlay.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1de15a80c8c1aa94486563740a15d91c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity index 0ddffa6..cbe4d3a 100644 --- a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity +++ b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity @@ -173,7 +173,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 + m_sendNavigationEvents: 0 m_DragThreshold: 10 --- !u!4 &74796459 Transform: @@ -9537,6 +9537,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 6354166569501586286, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_Padding.m_Right + value: 24 + objectReference: {fileID: 0} - target: {fileID: 6354166569501586286, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_ChildControlHeight value: 1 @@ -13231,6 +13235,11 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} +--- !u!224 &939125854 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + m_PrefabInstance: {fileID: 3531919738450164441} + m_PrefabAsset: {fileID: 0} --- !u!224 &1318590597 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 1963501579241001456, guid: 334eee9f85f308347844f8f5e99167c3, type: 3} @@ -13450,6 +13459,7 @@ RectTransform: - {fileID: 1983793178} - {fileID: 246947326} - {fileID: 1318590597} + - {fileID: 939125854} m_Father: {fileID: 1335662459} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -13643,6 +13653,107 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 334eee9f85f308347844f8f5e99167c3, type: 3} +--- !u!1001 &3531919738450164441 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1599240741} + m_Modifications: + - target: {fileID: 3531919739338806916, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_Name + value: Overlay + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3531919739979819163, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} --- !u!1001 &4478785627007410708 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs index e7e588a..aec8bfd 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs @@ -13,12 +13,31 @@ namespace AxibugEmuOnline.Client public string WebSiteApi => WebHost + "/api"; public delegate void GetRomListAPI(Action callback, int page, int pageSize = 10); + public delegate void SearchRomListAPI(Action callback, string searchKey, int page, int pageSize = 10); public void GetNesRomList(Action callback, int page, int pageSize = 10) { App.StartCoroutine(GetNesRomListFlow(page, pageSize, callback)); } + public void SearchNesRomList(Action callback, string searchKey, int page, int pageSize = 10) + { + App.StartCoroutine(SearchNesRomListFlow(searchKey, page, pageSize, callback)); + } + private IEnumerator SearchNesRomListFlow(string searchKey, int page, int pageSize, Action callback) + { + UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}&SearchKey={searchKey}"); + yield return request.SendWebRequest(); + + if (request.result != UnityWebRequest.Result.Success) + { + callback.Invoke(null); + yield break; + } + + var resp = JsonUtility.FromJson(request.downloadHandler.text); + callback.Invoke(resp); + } private IEnumerator GetNesRomListFlow(int page, int pageSize, Action callback) { UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}"); diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs index 8e5dfb6..7e1241d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs @@ -18,6 +18,7 @@ namespace AxibugEmuOnline.Client private Dictionary nesRomFileIdMapper = new Dictionary(); private Dictionary nesRomFileNameMapper = new Dictionary(); private HttpAPI.GetRomListAPI m_romGetFunc; + private HttpAPI.SearchRomListAPI m_romSearchFunc; private EnumPlatform m_platform; public RomLib(EnumPlatform platform) @@ -27,6 +28,7 @@ namespace AxibugEmuOnline.Client { case EnumPlatform.NES: m_romGetFunc = App.httpAPI.GetNesRomList; + m_romSearchFunc = App.httpAPI.SearchNesRomList; break; } } @@ -67,23 +69,44 @@ namespace AxibugEmuOnline.Client /// 获得所有Rom文件 /// /// - public void FetchRomCount(Action callback) + public void FetchRomCount(Action callback, string searchKey = null) { - m_romGetFunc((romList) => + if (string.IsNullOrWhiteSpace(searchKey)) { - FetchPageCmd.Clear(); - nesRomFileIdMapper.Clear(); - nesRomFileNameMapper.Clear(); - nesRomFetchList = new RomFile[romList.resultAllCount]; - for (int i = 0; i < nesRomFetchList.Length; i++) + m_romGetFunc((romList) => { - //以后考虑用对象池实例化RomFile - nesRomFetchList[i] = new RomFile(m_platform, i, i / PAGE_SIZE); - } - SaveRomInfoFromWeb(romList); + FetchPageCmd.Clear(); + nesRomFileIdMapper.Clear(); + nesRomFileNameMapper.Clear(); + nesRomFetchList = new RomFile[romList.resultAllCount]; + for (int i = 0; i < nesRomFetchList.Length; i++) + { + //以后考虑用对象池实例化RomFile + nesRomFetchList[i] = new RomFile(m_platform, i, i / PAGE_SIZE); + } + SaveRomInfoFromWeb(romList); - callback.Invoke(nesRomFetchList); - }, 0, PAGE_SIZE); + callback.Invoke(nesRomFetchList); + }, 0, PAGE_SIZE); + } + else + { + m_romSearchFunc((romList) => + { + FetchPageCmd.Clear(); + nesRomFileIdMapper.Clear(); + nesRomFileNameMapper.Clear(); + nesRomFetchList = new RomFile[romList.resultAllCount]; + for (int i = 0; i < nesRomFetchList.Length; i++) + { + //以后考虑用对象池实例化RomFile + nesRomFetchList[i] = new RomFile(m_platform, i, i / PAGE_SIZE); + } + SaveRomInfoFromWeb(romList); + + callback.Invoke(nesRomFetchList); + }, searchKey, 0, PAGE_SIZE); + } } public void BeginFetchRomInfo(RomFile romFile) diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs index 7a324a2..ce71d3c 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs @@ -28,6 +28,10 @@ namespace AxibugEmuOnline.Client m_pulsInvoker_Down = new PulseInvoker(OnCmdSelectItemDown, PulseInvoke_Delay, PulseInvoke_Interval); } + protected virtual void OnEnable() { } + protected virtual void OnDisable() { } + protected virtual void OnDestroy() { } + protected virtual void Update() { m_pulsInvoker_Left.Update(Time.deltaTime); @@ -36,6 +40,7 @@ namespace AxibugEmuOnline.Client m_pulsInvoker_Down.Update(Time.deltaTime); } + public void ResetPulsInvoker() { m_pulsInvoker_Left.DisActive(); diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs index c337bd5..aacebc1 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs @@ -1,7 +1,6 @@ using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.UI; -using Codice.Client.Common; using System; +using System.Collections.Generic; using UnityEngine; namespace AxibugEmuOnline.Client @@ -25,9 +24,84 @@ namespace AxibugEmuOnline.Client } } + private List m_options; + + protected override void Awake() + { + base.Awake(); + + m_options = new List() + { + new OptMenu_Search(this), + new OptMenu_ShowAll(this), + }; + } + + public string SearchKey; protected override void GetVirtualListDatas(Action datas) { - RomLib.FetchRomCount((roms) => datas.Invoke(roms)); - } + RomLib.FetchRomCount((roms) => datas.Invoke(roms), SearchKey); + } + + public override bool OnEnterItem() + { + var res = base.OnEnterItem(); + if (res) CommandDispatcher.Instance.RegistController(this); + + return true; + } + + public override bool OnExitItem() + { + var res = base.OnExitItem(); + if (res) CommandDispatcher.Instance.UnRegistController(this); + + return false; + } + + + protected override void OnCmdOptionMenu() + { + OptionUI.Instance.Pop(m_options); + } + + public class OptMenu_Search : ExecuteMenu + { + private RomListMenuItem m_romListUI; + + public OptMenu_Search(RomListMenuItem romListUI, Sprite icon = null) : base("", icon) + { + m_romListUI = romListUI; + } + + public override void OnExcute() + { + OverlayManager.Input((OnSearchCommit, "Rom", null)); + } + + private void OnSearchCommit(string text) + { + m_romListUI.SearchKey = text; + m_romListUI.RefreshUI(); + } + } + + public class OptMenu_ShowAll : ExecuteMenu + { + private RomListMenuItem m_ui; + + public override bool Visible => !string.IsNullOrWhiteSpace(m_ui.SearchKey); + + public OptMenu_ShowAll(RomListMenuItem romListUI,Sprite icon = null) : base("ʾȫ", icon) + { + m_ui = romListUI; + } + + public override void OnExcute() + { + m_ui.SearchKey = null; + m_ui.RefreshUI(); + } + } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs index e385778..815613c 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs @@ -6,7 +6,7 @@ using UnityEngine.UI; namespace AxibugEmuOnline.Client.UI { - public class MenuItem : MonoBehaviour + public class MenuItem : CommandExecuter { [SerializeField] protected Image Icon; @@ -32,16 +32,12 @@ namespace AxibugEmuOnline.Client.UI protected TweenerCore progressTween; protected float m_progress; - protected virtual void Awake() + protected override void Awake() { + base.Awake(); Reset(); } - protected virtual void OnDestroy() - { - - } - public void SetData(MenuData data) { Reset(); @@ -57,7 +53,7 @@ namespace AxibugEmuOnline.Client.UI m_progress = 0f; Root.localScale = Vector3.one * UnSelectScale; - + if (progressTween != null) { progressTween.Kill(); progressTween = null; } if (ShadowIcon != null) ShadowIcon.gameObject.SetActive(false); @@ -107,5 +103,7 @@ namespace AxibugEmuOnline.Client.UI public virtual bool OnEnterItem() => true; public virtual bool OnExitItem() => true; + + public override bool Enable => true; } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs index 4a3fba2..99f9dad 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs @@ -34,7 +34,7 @@ namespace AxibugEmuOnline.Client { value = Mathf.Clamp(value, 0, m_runtimeMenuItems.Count - 1); if (m_selectIndex == value) return; - + m_selectIndex = value; OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[m_selectIndex]; @@ -82,6 +82,8 @@ namespace AxibugEmuOnline.Client } if (dirty) { + Canvas.ForceUpdateCanvases(); + if (m_runtimeMenuItems[SelectIndex].Visible == false) { bool find = false; @@ -110,6 +112,14 @@ namespace AxibugEmuOnline.Client if (find) SelectIndex = currentSelect; } + else + { + var selectItem = m_runtimeMenuItems[SelectIndex]; + var itemUIRect = selectItem.transform as RectTransform; + SelectBorder.pivot = itemUIRect.pivot; + SelectBorder.position = itemUIRect.position; + SelectBorder.sizeDelta = itemUIRect.rect.size; + } } } @@ -195,6 +205,10 @@ namespace AxibugEmuOnline.Client menuUI.SetData(executeMenu); m_runtimeMenuItems.Add(menuUI); } + else + { + throw new NotImplementedException($"ݲֵ֧IJ˵{menuData.GetType().Name}"); + } } private void ReleaseRuntimeMenus() @@ -244,11 +258,11 @@ namespace AxibugEmuOnline.Client } } - public class ExecuteMenu : OptionMenu + public abstract class ExecuteMenu : OptionMenu { public ExecuteMenu(string name, Sprite icon = null) : base(name, icon) { } - public virtual void OnExcute() { } + public abstract void OnExcute(); } public abstract class ValueSetMenu : OptionMenu diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI.meta b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI.meta new file mode 100644 index 0000000..d655184 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6e1182d93bb09194297cdd775186071a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs new file mode 100644 index 0000000..43a9186 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class InputUI : OverlayUI + { + [SerializeField] + InputField m_input; + + Action OnCommit; + + + protected override void OnShow(object param) + { + (Action callback, string placeHolder, string defaultText) t = ((Action callback, string placeHolder, string defaultText))param; + + OnCommit = t.callback; + (m_input.placeholder as Text).text = t.placeHolder; + m_input.text = t.defaultText; + } + + protected override void OnEnable() + { + base.OnEnable(); + + StartCoroutine(ActiveInput()); + } + + private IEnumerator ActiveInput() + { + yield return new WaitForEndOfFrame(); + + m_input.Select(); + m_input.ActivateInputField(); + + yield break; + } + + protected override bool OnCmdEnter() + { + OnCommit?.Invoke(m_input.text); + Close(); + return true; + } + + protected override void OnCmdBack() + { + Close(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs.meta new file mode 100644 index 0000000..bd4edc8 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d366ee5eba9505c4ca908df5cfb35585 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs new file mode 100644 index 0000000..16eb9e9 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs @@ -0,0 +1,27 @@ +using System; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class OverlayManager : MonoBehaviour + { + static OverlayManager s_ins; + + [SerializeField] + InputUI m_InputUI; + + private void Awake() + { + s_ins = this; + + m_InputUI.gameObject.SetActive(false); + } + + public static InputUI Input((Action callback, string placeHolder, string defaultText) param) + { + s_ins.m_InputUI.Show(param); + + return s_ins.m_InputUI; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs.meta new file mode 100644 index 0000000..1c8a0ea --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 83ac6a2a0673d154cb98c7cc45663eb5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs new file mode 100644 index 0000000..083ead2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs @@ -0,0 +1,58 @@ +using DG.Tweening; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public abstract class OverlayUI : CommandExecuter + { + public override bool AloneMode => true; + public override bool Enable => true; + + public float StartAlpha = 0; + public float StartScale = 1.2f; + public float Duration = 0.5f; + public Ease Ease; + + [SerializeField] + protected Transform m_root; + [SerializeField] + protected CanvasGroup m_cg; + + protected override void OnEnable() + { + base.OnEnable(); + + float progress = 0; + DOTween.To(() => progress, (x) => + { + progress = x; + m_cg.alpha = Mathf.Lerp(StartAlpha, 1, x); + m_root.localScale = Vector3.Lerp(Vector3.one * StartScale, Vector3.one, x); + }, 1, Duration).SetEase(Ease).SetLink(gameObject, LinkBehaviour.KillOnDisable); + + CommandDispatcher.Instance.RegistController(this); + } + + protected override void OnDisable() + { + base.OnDisable(); + + CommandDispatcher.Instance.UnRegistController(this); + } + + public void Show(object param) + { + gameObject.SetActive(true); + OnShow(param); + } + public void Close() + { + OnClose(); + gameObject.SetActive(false); + } + protected abstract void OnShow(object param); + protected virtual void OnClose() { } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs.meta new file mode 100644 index 0000000..8a58bb7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e46843c32ed1d454fb95a0c99728b6f4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs b/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs index 8474398..85dfe70 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs @@ -1,9 +1,7 @@ using AxibugEmuOnline.Client.UI; -using Codice.Utils; using DG.Tweening; using DG.Tweening.Core; using DG.Tweening.Plugins.Options; -using System; using System.Collections.Generic; using UnityEngine; @@ -188,7 +186,7 @@ namespace AxibugEmuOnline.Client #if UNITY_EDITOR if (Application.isPlaying) { - var item= GameObject.Instantiate(template.gameObject, parent).GetComponent(); + var item = GameObject.Instantiate(template.gameObject, parent).GetComponent(); item.transform.localPosition = Vector3.zero; return item; } From e9dd949c10630d6e0267b33eef0f5d52ed567aff Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 13 Nov 2024 14:03:11 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Script/UI/CommandDispatcher/CommandDispatcher.cs | 1 - .../Assets/Script/UI/OptionUI/OptionUI.cs | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs index 3beece3..1a874a7 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using UnityEngine; diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs index 99f9dad..7f59fb4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs @@ -1,6 +1,7 @@ using DG.Tweening; using System; using System.Collections.Generic; +using System.Linq; using UnityEngine; namespace AxibugEmuOnline.Client @@ -32,12 +33,13 @@ namespace AxibugEmuOnline.Client get { return m_selectIndex; } set { - value = Mathf.Clamp(value, 0, m_runtimeMenuItems.Count - 1); + var selectableItems = m_runtimeMenuItems.Where(t => t.Visible).ToList(); + value = Mathf.Clamp(value, 0, selectableItems.Count - 1); if (m_selectIndex == value) return; - + m_selectIndex = value; - OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[m_selectIndex]; + OptionUI_MenuItem optionUI_MenuItem = selectableItems[m_selectIndex]; optionUI_MenuItem.OnFocus(); var itemUIRect = optionUI_MenuItem.transform as RectTransform; SelectBorder.pivot = itemUIRect.pivot; From ae9fee30ef3919b35ca631a5f8844fe041120095 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 13 Nov 2024 18:42:30 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=98=E6=A1=A3?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Resources/NES/NesEmulator.prefab | 183 +++++++++++++----- .../Assets/Script/IEmuCore.cs | 1 + .../Assets/Script/Manager/AppEmu.cs | 7 + .../Assets/Script/NesEmulator/NesEmulator.cs | 52 ++--- .../Script/NesEmulator/PatternViewer.cs | 51 ++++- .../Assets/Script/UI/InGameUI/InGameUI.cs | 6 +- .../Script/UI/InGameUI/InGameUI_Reset.cs | 28 +++ .../Script/UI/InGameUI/InGameUI_Reset.cs.meta | 11 ++ .../VirtualNes.Core/CoreLibs/ByteArrayRef.cs | 1 + .../VirtualNes.Core/Mapper/Mapper001.cs | 16 +- .../VirtualNes.Core/Mapper/Mapper004.cs | 5 + .../Assets/VirtualNes.Core/NES.cs | 56 +++--- 12 files changed, 308 insertions(+), 109 deletions(-) create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Resources/NES/NesEmulator.prefab b/AxibugEmuOnline.Client/Assets/Resources/NES/NesEmulator.prefab index 6d24d5d..29b2f60 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/NES/NesEmulator.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/NES/NesEmulator.prefab @@ -30,7 +30,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4232056521131536011} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &9003897287163669553 MonoBehaviour: @@ -141,6 +141,78 @@ AudioSource: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!1 &3297772745682094737 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3430872171738201552} + - component: {fileID: 183509793067265912} + - component: {fileID: 1908580308043775702} + m_Layer: 5 + m_Name: img + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3430872171738201552 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3297772745682094737} + 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_Children: [] + m_Father: {fileID: 1038087993597378172} + 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!222 &183509793067265912 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3297772745682094737} + m_CullTransparentMesh: 1 +--- !u!114 &1908580308043775702 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3297772745682094737} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 --- !u!1 &3545890545112170401 GameObject: m_ObjectHideFlags: 0 @@ -150,8 +222,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1038087993597378172} - - component: {fileID: 3032498056073774270} - - component: {fileID: 634277252673086327} + - component: {fileID: 4772135422360773263} m_Layer: 5 m_Name: Viewer m_TagString: Untagged @@ -166,27 +237,21 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3545890545112170401} - m_LocalRotation: {x: 1, y: 0, z: 0, w: 0} + 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_Children: [] + m_Children: + - {fileID: 3430872171738201552} + - {fileID: 5684774662137182450} m_Father: {fileID: 4232056520494431727} m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 128, y: 256} - m_Pivot: {x: 0, y: 0} ---- !u!222 &3032498056073774270 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3545890545112170401} - m_CullTransparentMesh: 1 ---- !u!114 &634277252673086327 + m_Pivot: {x: 0, y: 1} +--- !u!114 &4772135422360773263 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -195,24 +260,11 @@ MonoBehaviour: m_GameObject: {fileID: 3545890545112170401} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Script: {fileID: 11500000, guid: c7a50c189f5be5b4ea54de444f8488a0, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Texture: {fileID: 8400000, guid: ffe34aaf87e4b9942b4c2ac05943d444, type: 2} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 + img: {fileID: 1908580308043775702} + select: {fileID: 5340715074145844681} --- !u!1 &4232056520112715746 GameObject: m_ObjectHideFlags: 0 @@ -292,7 +344,7 @@ RectTransform: - {fileID: 4232056521759880275} - {fileID: 1038087993597378172} m_Father: {fileID: 4232056521131536011} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -389,7 +441,6 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4232056520112715745} - - {fileID: 393435831810118449} - {fileID: 4785916497946256520} - {fileID: 4232056520494431727} m_Father: {fileID: 0} @@ -409,6 +460,7 @@ MonoBehaviour: m_EditorClassIdentifier: VideoProvider: {fileID: 4232056520112715744} AudioProvider: {fileID: 9003897287163669553} + m_bPause: 0 --- !u!1 &4232056521759880276 GameObject: m_ObjectHideFlags: 0 @@ -481,7 +533,7 @@ MonoBehaviour: y: 0 width: 1 height: 1 ---- !u!1 &7856060136050839404 +--- !u!1 &9165783203684222035 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -489,39 +541,74 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 393435831810118449} - - component: {fileID: 499856625911497759} - m_Layer: 0 - m_Name: PatternViewer + - component: {fileID: 5684774662137182450} + - component: {fileID: 8664526960435983253} + - component: {fileID: 5340715074145844681} + m_Layer: 5 + m_Name: Text m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &393435831810118449 -Transform: + m_IsActive: 1 +--- !u!224 &5684774662137182450 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7856060136050839404} + m_GameObject: {fileID: 9165783203684222035} 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_Children: [] - m_Father: {fileID: 4232056521131536011} + m_Father: {fileID: 1038087993597378172} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &499856625911497759 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: -41} + m_SizeDelta: {x: 0, y: 30} + m_Pivot: {x: 0.5, y: 0} +--- !u!222 &8664526960435983253 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9165783203684222035} + m_CullTransparentMesh: 1 +--- !u!114 &5340715074145844681 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7856060136050839404} + m_GameObject: {fileID: 9165783203684222035} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c7a50c189f5be5b4ea54de444f8488a0, type: 3} + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: - img: {fileID: 634277252673086327} + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: New Text diff --git a/AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs b/AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs index 34c04d6..1a8d20e 100644 --- a/AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs +++ b/AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs @@ -14,6 +14,7 @@ namespace AxibugEmuOnline.Client void Resume(); void SetupScheme(); void StartGame(RomFile romFile); + void DoReset(); } public static class IEnumCoreTool diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs index 42547cf..3a7df7d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs @@ -68,5 +68,12 @@ namespace AxibugEmuOnline.Client.Manager ControlScheme.Current = ControlSchemeSetts.Normal; } + + public void ResetGame() + { + if(m_emuCore.IsNull()) return; + + m_emuCore.DoReset(); + } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs index 425e9bc..7c41565 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs @@ -1,4 +1,5 @@ using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Common; using System; using System.Diagnostics; using System.IO; @@ -112,30 +113,9 @@ namespace AxibugEmuOnline.Client } - - [Conditional("UNITY_EDITOR")] - [ContextMenu("ImportNesDB")] - public void ImportNesDB() + public void DoReset() { - var db = Resources.Load("NES/ROMDB"); - db.Clear(); - - var xmlStr = File.ReadAllText("nes20db.xml"); - var xml = XDocument.Parse(xmlStr); - var games = xml.Element("nes20db").Elements("game"); - foreach (var game in games) - { - var crcStr = game.Element("rom").Attribute("crc32").Value; - var crc = uint.Parse($"{crcStr}", System.Globalization.NumberStyles.HexNumber); - - var mapper = int.Parse($"{game.Element("pcb").Attribute("mapper").Value}"); - - if (mapper > 255) continue; - db.AddInfo(new RomDB.RomInfo { CRC = crc, Mapper = mapper }); - } - - UnityEditor.EditorUtility.SetDirty(db); - UnityEditor.AssetDatabase.SaveAssets(); + NesCore.Reset(); } public void SetupScheme() @@ -164,5 +144,31 @@ namespace AxibugEmuOnline.Client st.FromByte(data); NesCore.LoadState(st); } + + + [Conditional("UNITY_EDITOR")] + [ContextMenu("ImportNesDB")] + public void ImportNesDB() + { + var db = Resources.Load("NES/ROMDB"); + db.Clear(); + + var xmlStr = File.ReadAllText("nes20db.xml"); + var xml = XDocument.Parse(xmlStr); + var games = xml.Element("nes20db").Elements("game"); + foreach (var game in games) + { + var crcStr = game.Element("rom").Attribute("crc32").Value; + var crc = uint.Parse($"{crcStr}", System.Globalization.NumberStyles.HexNumber); + + var mapper = int.Parse($"{game.Element("pcb").Attribute("mapper").Value}"); + + if (mapper > 255) continue; + db.AddInfo(new RomDB.RomInfo { CRC = crc, Mapper = mapper }); + } + + UnityEditor.EditorUtility.SetDirty(db); + UnityEditor.AssetDatabase.SaveAssets(); + } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs index 4b522b9..3770957 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs @@ -1,7 +1,10 @@ -using System.Collections.Generic; +using AxibugEmuOnline.Client.Common; +using System.Collections.Generic; using UnityEngine; +using UnityEngine.EventSystems; using UnityEngine.UI; using VirtualNes; +using VirtualNes.Core; using static AxibugEmuOnline.Client.PaletteDefine; namespace AxibugEmuOnline.Client @@ -9,24 +12,40 @@ namespace AxibugEmuOnline.Client public class PatternViewer : MonoBehaviour { public RawImage img; + public Text select; private Color32[] m_lpPattern = new Color32[128 * 256]; private Texture2D m_texture; private Dictionary colors = new Dictionary(); + private int selectPal = 0; + private void Awake() { m_texture = new Texture2D(128, 256); + m_texture.filterMode = FilterMode.Point; } private void Update() { + if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.T)) + { + SwitchSelectPal(); + } Paint(); } private void OnEnable() { img.gameObject.SetActive(true); + if (selectPal < 4) + { + select.text = $"PatternView BG{(selectPal & 3):00}"; + } + else + { + select.text = $"PatternView SP{(selectPal & 3):00}"; + } } private void OnDisable() @@ -38,7 +57,16 @@ namespace AxibugEmuOnline.Client { img.texture = m_texture; - var pal = MMU.SPPAL; + ArrayRef pal = null; + if (selectPal < 4) + { + pal = new ArrayRef(MMU.BGPAL, selectPal * 4); + } + else + { + pal = new ArrayRef(MMU.SPPAL, (selectPal & 3) * 4); + } + var palette = PaletteDefine.GetPaletteData(); colors[0] = palette[pal[0]]; colors[1] = palette[pal[1]]; @@ -48,6 +76,12 @@ namespace AxibugEmuOnline.Client for (int i = 0; i < 8; i++) { var Ptn = MMU.PPU_MEM_BANK[i]; + + if (Input.GetKeyDown(KeyCode.T)) + { + Debug.Log($"{i}:{Ptn.Offset}\t{Helper.FileMD5Hash(Ptn.RawArray)}"); + } + int lpPtn = 0; for (int p = 0; p < 64; p++) { @@ -81,5 +115,18 @@ namespace AxibugEmuOnline.Client var raw = map[(byte)v]; return new Color32(raw.rgbRed, raw.rgbGreen, raw.rgbBlue, 255); } + + void SwitchSelectPal() + { + selectPal = (selectPal + 1) & 7; + if (selectPal < 4) + { + select.text = $"PatternView BG{(selectPal & 3):00}"; + } + else + { + select.text = $"PatternView SP{(selectPal & 3):00}"; + } + } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs index 4ff876a..48ee393 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs @@ -38,16 +38,18 @@ namespace AxibugEmuOnline.Client m_stepPerformer = new StepPerformer(this); + menus.Add(new InGameUI_Reset(this)); menus.Add(new InGameUI_SaveState(this)); menus.Add(new InGameUI_LoadState(this)); menus.Add(new InGameUI_QuitGame(this)); base.Awake(); } - - private void OnDestroy() + + protected override void OnDestroy() { Instance = null; + base.OnDestroy(); } /// ٿ diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs b/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs new file mode 100644 index 0000000..8e57213 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs @@ -0,0 +1,28 @@ +using AxibugEmuOnline.Client.ClientCore; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Security.Cryptography; +using System.Text; + +namespace AxibugEmuOnline.Client +{ + public class InGameUI_Reset : ExecuteMenu + { + private InGameUI m_gameUI; + + public override bool Visible => !m_gameUI.IsNetPlay || App.roomMgr.IsHost; + + public InGameUI_Reset(InGameUI gameUI) : base("λ", null) + { + m_gameUI = gameUI; + } + + public override void OnExcute() + { + if (!m_gameUI.IsNetPlay) + { + App.emu.ResetGame(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs.meta new file mode 100644 index 0000000..11439f7 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eedc9c8d06bb21242bb50bee6ca858fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs index 7a23915..8333658 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs @@ -4,6 +4,7 @@ namespace VirtualNes.Core { public class ArrayRef { + public T[] RawArray => m_rawArray; private T[] m_rawArray; private int m_offset; private int m_length; diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper001.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper001.cs index 9447bb5..98885c4 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper001.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper001.cs @@ -10,8 +10,7 @@ namespace VirtualNes.Core { public class Mapper001 : Mapper { - - uint last_addr; + ushort last_addr; BYTE patch; BYTE wram_patch; @@ -131,7 +130,6 @@ namespace VirtualNes.Core } } - private ArrayRef _PROM_BANK = new ArrayRef(); //void Mapper001::Write(WORD addr, BYTE data) public override void Write(ushort addr, byte data) { @@ -145,13 +143,11 @@ namespace VirtualNes.Core { if (wram_bank != 0) { - _PROM_BANK.SetArray(WRAM, 0x2000); - SetPROM_Bank(3, _PROM_BANK, BANKTYPE_RAM); + SetPROM_Bank(3, new ArrayRef(WRAM, 0x2000), BANKTYPE_RAM); } else { - _PROM_BANK.SetArray(WRAM, 0x0000); - SetPROM_Bank(3, _PROM_BANK, BANKTYPE_RAM); + SetPROM_Bank(3, new ArrayRef(WRAM, 0x0000), BANKTYPE_RAM); } wram_bank = wram_count = 0; } @@ -292,13 +288,11 @@ namespace VirtualNes.Core { if (((reg[1] & 0x18) == 0)) { - _PROM_BANK.SetArray(WRAM, 0x0000); - SetPROM_Bank(3, _PROM_BANK, BANKTYPE_RAM); + SetPROM_Bank(3, new ArrayRef(WRAM, 0x0000), BANKTYPE_RAM); } else { - _PROM_BANK.SetArray(WRAM, 0x2000); - SetPROM_Bank(3, _PROM_BANK, BANKTYPE_RAM); + SetPROM_Bank(3, new ArrayRef(WRAM, 0x2000), BANKTYPE_RAM); } } diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper004.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper004.cs index c97e478..5f6916d 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper004.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper004.cs @@ -26,6 +26,11 @@ namespace VirtualNes.Core protected byte vs_patch; protected byte vs_index; + public override bool IsStateSave() + { + return true; + } + private byte[] VS_TKO_Security = new byte[32] { 0xff, 0xbf, 0xb7, 0x97, 0x97, 0x17, 0x57, 0x4f, diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs index b3fa228..6d3b719 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs @@ -911,7 +911,7 @@ namespace VirtualNes.Core CPU_CALL_COUNT++; } - internal void Reset() + public void Reset() { SaveSRAM(); SaveDISK(); @@ -1024,7 +1024,7 @@ namespace VirtualNes.Core - internal void SoftReset() + public void SoftReset() { pad.Reset(); cpu.Reset(); @@ -1974,23 +1974,45 @@ namespace VirtualNes.Core // BANK0,1,2ϥХ󥯥`֤vSʤ // VirtuaNES0.30 // Х󥯣SRAMʹäv餺` - for (int i = 3; i < 8; i++) + for (byte i = 3; i < 8; i++) { MMU.CPU_MEM_TYPE[i] = state.mmu.CPU_MEM_TYPE[i]; MMU.CPU_MEM_PAGE[i] = state.mmu.CPU_MEM_PAGE[i]; + if (MMU.CPU_MEM_TYPE[i] == MMU.BANKTYPE_ROM) + MMU.SetPROM_8K_Bank(i, MMU.CPU_MEM_PAGE[i]); + else + { + MMU.CPU_MEM_BANK[i].SetArray(state.CPU_MEM_BANK.ToArray(), 0); + } } - // SAVE VRAM MEMORY DATA - for (int i = 0; i < 12; i++) - { - MMU.PPU_MEM_TYPE[i] = state.mmu.PPU_MEM_TYPE[i]; - MMU.PPU_MEM_PAGE[i] = state.mmu.PPU_MEM_PAGE[i]; - } - + // VRAM + MemoryUtility.memcpy(MMU.VRAM, state.VRAM, 4 * 1024); + // CRAM for (int i = 0; i < 8; i++) { MMU.CRAM_USED[i] = state.mmu.CRAM_USED[i]; } + // SAVE VRAM MEMORY DATA + for (byte i = 0; i < 12; i++) + { + if (state.mmu.PPU_MEM_TYPE[i] == MMU.BANKTYPE_VROM) + { + MMU.SetVROM_1K_Bank(i, state.mmu.PPU_MEM_PAGE[i]); + } + else if (state.mmu.PPU_MEM_TYPE[i] == MMU.BANKTYPE_CRAM) + { + MMU.SetCRAM_1K_Bank(i, state.mmu.PPU_MEM_PAGE[i]); + } + else if (state.mmu.PPU_MEM_TYPE[i] == MMU.BANKTYPE_VRAM) + { + MMU.SetVRAM_1K_Bank(i, state.mmu.PPU_MEM_PAGE[i]); + } + else + { + throw new Exception("Unknown bank types."); + } + } // WRITE CPU RAM MEMORY BANK @@ -2024,17 +2046,7 @@ namespace VirtualNes.Core // MMC STATE { - state.mmc = MMCSTAT.GetDefault(); - - // Create Header - state.mmcBLOCK.ID = "MMC DATA"; - state.mmcBLOCK.BlockVersion = 0x0100; - state.mmcBLOCK.BlockSize = state.mmc.GetSize(); - - if (mapper.IsStateSave()) - { - mapper.LoadState(state.mmc.mmcdata); - } + mapper.LoadState(state.mmc.mmcdata); } //CONTROLLER STATE @@ -2048,8 +2060,6 @@ namespace VirtualNes.Core //SND STATE { - state.snd = SNDSTAT.GetDefault(); - var buffer = new StateReader(state.snd.snddata); apu.LoadState(buffer); } From 3913595b18cabab05931db727215c4501fdefe14 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 13 Nov 2024 19:25:46 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E7=A7=BB=E9=99=A4debug=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/NesEmulator/PatternViewer.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs index 3770957..11e190d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs @@ -1,7 +1,5 @@ -using AxibugEmuOnline.Client.Common; -using System.Collections.Generic; +using System.Collections.Generic; using UnityEngine; -using UnityEngine.EventSystems; using UnityEngine.UI; using VirtualNes; using VirtualNes.Core; @@ -77,11 +75,6 @@ namespace AxibugEmuOnline.Client { var Ptn = MMU.PPU_MEM_BANK[i]; - if (Input.GetKeyDown(KeyCode.T)) - { - Debug.Log($"{i}:{Ptn.Offset}\t{Helper.FileMD5Hash(Ptn.RawArray)}"); - } - int lpPtn = 0; for (int p = 0; p < 64; p++) { From 43e7ba83320428df1727cc9f93f48e2146bbb3a4 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 14 Nov 2024 11:17:17 +0800 Subject: [PATCH 05/14] =?UTF-8?q?ppu=20lpScreen=E6=94=B9=E4=B8=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/NesEmulator/NesEmulator.cs | 4 +- .../Script/NesEmulator/VideoProvider.cs | 10 +- .../Assets/VirtualNes.Core/NES.cs | 6 +- .../Assets/VirtualNes.Core/PPU.cs | 514 +++++++++--------- 4 files changed, 259 insertions(+), 275 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs index 7c41565..c329c7b 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs @@ -51,7 +51,7 @@ namespace AxibugEmuOnline.Client NesCore = null; } - private void Update() + private unsafe void Update() { if (m_bPause) return; @@ -63,7 +63,7 @@ namespace AxibugEmuOnline.Client var screenBuffer = NesCore.ppu.GetScreenPtr(); var lineColorMode = NesCore.ppu.GetLineColorMode(); - VideoProvider.SetDrawData(screenBuffer, lineColorMode, 256, 240); + VideoProvider.SetDrawData(screenBuffer, lineColorMode, 277, 240); } } diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs index 1a92750..0462d4b 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs @@ -24,15 +24,15 @@ namespace AxibugEmuOnline.Client DrawCanvas.worldCamera = Camera.main; } - public void SetDrawData(uint[] screenData, byte[] lineColorMode, int screenWidth, int screenHeight) + public unsafe void SetDrawData(byte* screenData, byte[] lineColorMode, int screenWidth, int screenHeight) { if (wrapTex == null) { //wrapTex = new Texture2D(272, 240, TextureFormat.BGRA32, false); wrapTex = new Texture2D(272, 240, TextureFormat.RGBA32, false); wrapTex.filterMode = FilterMode.Point; - wrapTexBuffer = screenData; + wrapTexBuffer = new uint[screenWidth * screenHeight]; // ̶飬ֹƶ GCHandle handle = GCHandle.Alloc(wrapTexBuffer, GCHandleType.Pinned); // ȡָ @@ -44,7 +44,6 @@ namespace AxibugEmuOnline.Client TexBufferSize = wrapTexBuffer.Length * 4; var palRaw = PaletteDefine.m_cnPalette[0]; - //pPal = new Texture2D(palRaw.Length, 1, TextureFormat.BGRA32, 1, true); pPal = new Texture2D(palRaw.Length, 1, TextureFormat.RGBA32, false); pPal.filterMode = FilterMode.Point; for (int i = 0; i < palRaw.Length; i++) @@ -62,6 +61,11 @@ namespace AxibugEmuOnline.Client Image.material.SetTexture("_PalTex", pPal); } + for (int i = 0; i < wrapTexBuffer.Length; i++) + { + wrapTexBuffer[i] = screenData[i]; + } + wrapTex.LoadRawTextureData(wrapTexBufferPointer, TexBufferSize); wrapTex.Apply(); } diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs index 6d3b719..0be9780 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs @@ -221,7 +221,7 @@ namespace VirtualNes.Core Debuger.Log("Allocating PPU..."); ppu = new PPU(this); - var screenBuffer = new uint[PPU.SCREEN_WIDTH * PPU.SCREEN_HEIGHT]; + var screenBuffer = new byte[PPU.SCREEN_WIDTH * PPU.SCREEN_HEIGHT]; var colormode = new byte[PPU.SCREEN_HEIGHT]; ppu.SetScreenPtr(screenBuffer, colormode); @@ -840,7 +840,7 @@ namespace VirtualNes.Core } } - internal void DrawFont(int x, int y, byte chr, byte col) + internal unsafe void DrawFont(int x, int y, byte chr, byte col) { int i; int pFnt; @@ -866,7 +866,7 @@ namespace VirtualNes.Core } } - private void DrawBitmap(int x, int y, byte[] bitMap) + private unsafe void DrawBitmap(int x, int y, byte[] bitMap) { int i, j; int h, v; diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/PPU.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/PPU.cs index ab9fe05..d736264 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/PPU.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/PPU.cs @@ -1,10 +1,24 @@ -namespace VirtualNes.Core +using Codice.CM.Client.Differences; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using UnityEngine.UIElements; + +namespace VirtualNes.Core { - public class PPU + public unsafe class PPU { - public const int SCREEN_WIDTH = 256 + 16; + public const int SCREEN_WIDTH = 272; public const int SCREEN_HEIGHT = 240; + private GCHandle BGwriteGCH; + private GCHandle BGmonoGCH; + private GCHandle SPwriteGCH; + + private byte* BGwrite; + private byte* BGmono; + private byte* SPwrite; + private static byte[][] CreateCOLORMAP() { byte[][] res = new byte[5][]; @@ -104,9 +118,10 @@ private ushort loopy_y; private ushort loopy_shift; - private uint[] lpScreen; + private GCHandle lpScreenGCH; + private byte* lpScreen; /// 作为lpScreen数组的索引 - private int lpScanline; + private byte* lpScanline; private int ScanlineNo; private byte[] lpColormode; @@ -137,9 +152,22 @@ } Bit2Rev[i] = c; } + + BGwriteGCH = GCHandle.Alloc(new byte[33 + 1], GCHandleType.Pinned); + BGmonoGCH = GCHandle.Alloc(new byte[33 + 1], GCHandleType.Pinned); + SPwriteGCH = GCHandle.Alloc(new byte[33 + 1], GCHandleType.Pinned); + BGwrite = (byte*)BGwriteGCH.AddrOfPinnedObject(); + BGmono = (byte*)BGmonoGCH.AddrOfPinnedObject(); + SPwrite = (byte*)SPwriteGCH.AddrOfPinnedObject(); } - public void Dispose() { } + public void Dispose() + { + lpScreenGCH.Free(); + BGwriteGCH.Free(); + BGmonoGCH.Free(); + SPwriteGCH.Free(); + } internal byte Read(ushort addr) { @@ -199,7 +227,7 @@ ScanlineNo = scanline; if (scanline < 240) { - lpScanline = (SCREEN_WIDTH) * scanline; + lpScanline = lpScreen + SCREEN_WIDTH * scanline; } } @@ -358,7 +386,7 @@ loopy_shift = 0; if (lpScreen != null) - MemoryUtility.memset(lpScreen, 0, 0x3F, SCREEN_WIDTH * SCREEN_HEIGHT); + Unsafe.InitBlockUnaligned(lpScreen, 0, SCREEN_WIDTH * SCREEN_HEIGHT); if (lpColormode != null) MemoryUtility.memset(lpColormode, 0, SCREEN_HEIGHT); } @@ -374,7 +402,7 @@ if (lpScreen != null) { - MemoryUtility.memset(lpScreen, 0, 0x3F, SCREEN_WIDTH); + Unsafe.InitBlockUnaligned(lpScreen, 0x3F, SCREEN_WIDTH); } if (lpColormode != null) { @@ -425,18 +453,12 @@ } } - private byte[] BGwrite = new byte[33 + 1]; - private byte[] BGmono = new byte[33 + 1]; - private byte[] SPwrite = new byte[33 + 1]; - internal void Scanline(int scanline, bool bMax, bool bLeftClip) { - int pScn = 0; - int pBGw = 0; byte chr_h = 0, chr_l = 0, attr = 0; - MemoryUtility.ZEROMEMORY(BGwrite, BGwrite.Length); - MemoryUtility.ZEROMEMORY(BGmono, BGmono.Length); + Unsafe.InitBlockUnaligned(BGwrite, 0, 34); + Unsafe.InitBlockUnaligned(BGmono, 0, 34); // Linecolor mode lpColormode[scanline] = (byte)(((MMU.PPUREG[1] & PPU_BGCOLOR_BIT) >> 5) | ((MMU.PPUREG[1] & PPU_COLORMODE_BIT) << 7)); @@ -444,7 +466,7 @@ // Render BG if ((MMU.PPUREG[1] & PPU_BGDISP_BIT) == 0) { - MemoryUtility.memset(lpScreen, lpScanline, MMU.BGPAL[0], SCREEN_WIDTH); + Unsafe.InitBlockUnaligned(lpScanline, MMU.BGPAL[0], SCREEN_WIDTH); if (nes.GetRenderMethod() == EnumRenderMethod.TILE_RENDER) { nes.EmulationCPU(NES.FETCH_CYCLES * 4 * 32); @@ -457,9 +479,8 @@ if (!bExtLatch) { // Without Extension Latch - pScn = lpScanline + (8 - loopy_shift); - pBGw = 0; - + byte* pScn = lpScanline + (8 - loopy_shift); + byte* pBGw = BGwrite; int tileofs = (MMU.PPUREG[0] & PPU_BGTBL_BIT) << 8; int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); int attradr = 0x23C0 + (MMU.loopy_v & 0x0C00) + ((MMU.loopy_v & 0x0380) >> 4); @@ -475,7 +496,6 @@ attradr &= 0x3FF; - for (int i = 0; i < 33; i++) { tileadr = tileofs + pNTBL[ntbladr & 0x03FF] * 0x10 + loopy_y; @@ -483,17 +503,9 @@ if (cache_tile == tileadr && cache_attr == attr) { - lpScreen[pScn + 0] = lpScreen[pScn - 8]; - lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; - lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; - lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; - - lpScreen[pScn + 4] = lpScreen[pScn - 4]; - lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; - lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; - lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; - - BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + *(uint*)(pScn + 0) = *(uint*)(pScn - 8); + *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(pBGw + 0) = *(pBGw - 1); } else { @@ -501,20 +513,20 @@ cache_attr = attr; chr_l = MMU.PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; chr_h = MMU.PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; - BGwrite[pBGw] = (byte)(chr_h | chr_l); + *pBGw = (byte)(chr_h | chr_l); - int pBGPAL = attr; + fixed (byte* pBGPAL = &MMU.BGPAL[attr]) { int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); - lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + (c1 >> 6)]; - lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; - lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + ((c1 >> 6))]; - lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; - lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; - lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; - lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; - lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + pScn[0] = pBGPAL[(c1 >> 6)]; + pScn[4] = pBGPAL[(c1 >> 2) & 3]; + pScn[1] = pBGPAL[(c2 >> 6)]; + pScn[5] = pBGPAL[(c2 >> 2) & 3]; + pScn[2] = pBGPAL[(c1 >> 4) & 3]; + pScn[6] = pBGPAL[c1 & 3]; + pScn[3] = pBGPAL[(c2 >> 4) & 3]; + pScn[7] = pBGPAL[c2 & 3]; } } pScn += 8; @@ -542,8 +554,8 @@ else { // With Extension Latch(For MMC5) - pScn = lpScanline + (8 - loopy_shift); - pBGw = 0; + byte* pScn = lpScanline + (8 - loopy_shift); + byte* pBGw = BGwrite; int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); int ntbl_x = ntbladr & 0x1F; @@ -564,35 +576,27 @@ { cache_tile = ((chr_h << 8) + chr_l); cache_attr = attr; - BGwrite[pBGw] = (byte)(chr_h | chr_l); + *pBGw = (byte)(chr_h | chr_l); - int pBGPAL = attr; + fixed (byte* pBGPAL = &MMU.BGPAL[attr]) { int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); - lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + (c1 >> 6)]; - lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; - lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + (c2 >> 6)]; - lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; - lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; - lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; - lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; - lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + pScn[0] = pBGPAL[(c1 >> 6)]; + pScn[4] = pBGPAL[(c1 >> 2) & 3]; + pScn[1] = pBGPAL[(c2 >> 6)]; + pScn[5] = pBGPAL[(c2 >> 2) & 3]; + pScn[2] = pBGPAL[(c1 >> 4) & 3]; + pScn[6] = pBGPAL[c1 & 3]; + pScn[3] = pBGPAL[(c2 >> 4) & 3]; + pScn[7] = pBGPAL[c2 & 3]; } } else { - lpScreen[pScn + 0] = lpScreen[pScn - 8]; - lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; - lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; - lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; - - lpScreen[pScn + 4] = lpScreen[pScn - 4]; - lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; - lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; - lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; - - BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + *(uint*)(pScn + 0) = *(uint*)(pScn - 8); + *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(pBGw + 0) = *(pBGw - 1); } pScn += 8; pBGw++; @@ -616,8 +620,8 @@ // Without Extension Latch if (!bExtNameTable) { - pScn = lpScanline + (8 - loopy_shift); - pBGw = 0; + byte* pScn = lpScanline + (8 - loopy_shift); + byte* pBGw = BGwrite; int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); int attradr = 0x03C0 + ((MMU.loopy_v & 0x0380) >> 4); @@ -649,35 +653,27 @@ chr_l = MMU.PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; chr_h = MMU.PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; - lpScreen[pBGw] = (byte)(chr_l | chr_h); + *pBGw = (byte)(chr_l | chr_h); - int pBGPAL = attr; + fixed (byte* pBGPAL = &MMU.BGPAL[attr]) { int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); - lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + (c1 >> 6)]; - lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; - lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + ((c2 >> 6))]; - lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; - lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; - lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; - lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; - lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + pScn[0] = pBGPAL[(c1 >> 6)]; + pScn[4] = pBGPAL[(c1 >> 2) & 3]; + pScn[1] = pBGPAL[(c2 >> 6)]; + pScn[5] = pBGPAL[(c2 >> 2) & 3]; + pScn[2] = pBGPAL[(c1 >> 4) & 3]; + pScn[6] = pBGPAL[c1 & 3]; + pScn[3] = pBGPAL[(c2 >> 4) & 3]; + pScn[7] = pBGPAL[c2 & 3]; } } else { - lpScreen[pScn + 0] = lpScreen[pScn - 8]; - lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; - lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; - lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; - - lpScreen[pScn + 4] = lpScreen[pScn - 4]; - lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; - lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; - lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; - - BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + *(uint*)(pScn + 0) = *(uint*)(pScn - 8); + *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(pBGw + 0) = *(pBGw - 1); } pScn += 8; pBGw++; @@ -703,8 +699,8 @@ } else { - pScn = lpScanline + (8 - loopy_shift); - pBGw = 0; + byte* pScn = lpScanline + (8 - loopy_shift); + byte* pBGw = BGwrite; int ntbladr; int tileadr; @@ -733,35 +729,27 @@ chr_l = MMU.PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; chr_h = MMU.PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; - BGwrite[pBGw] = (byte)(chr_l | chr_h); + *pBGw = (byte)(chr_l | chr_h); - int pBGPAL = attr; + fixed (byte* pBGPAL = &MMU.BGPAL[attr]) { int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); - lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + (c1 >> 6)]; - lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; - lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + (c2 >> 6)]; - lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; - lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; - lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; - lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; - lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + pScn[0] = pBGPAL[(c1 >> 6)]; + pScn[4] = pBGPAL[(c1 >> 2) & 3]; + pScn[1] = pBGPAL[(c2 >> 6)]; + pScn[5] = pBGPAL[(c2 >> 2) & 3]; + pScn[2] = pBGPAL[(c1 >> 4) & 3]; + pScn[6] = pBGPAL[c1 & 3]; + pScn[3] = pBGPAL[(c2 >> 4) & 3]; + pScn[7] = pBGPAL[c2 & 3]; } } else { - lpScreen[pScn + 0] = lpScreen[pScn - 8]; - lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; - lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; - lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; - - lpScreen[pScn + 4] = lpScreen[pScn - 4]; - lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; - lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; - lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; - - BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + *(uint*)(pScn + 0) = *(uint*)(pScn - 8); + *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(pBGw + 0) = *(pBGw - 1); } pScn += 8; pBGw++; @@ -787,8 +775,8 @@ else { // With Extension Latch(For MMC5) - pScn = lpScanline + (8 - loopy_shift); - pBGw = 0; + byte* pScn = lpScanline + (8 - loopy_shift); + byte* pBGw = BGwrite; int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); int ntbl_x = ntbladr & 0x1F; @@ -813,35 +801,27 @@ { cache_tile = ((chr_h << 8) + chr_l); cache_attr = attr; - BGwrite[pBGw] = (byte)(chr_l | chr_h); + *pBGw = (byte)(chr_l | chr_h); - int pBGPAL = attr; + fixed (byte* pBGPAL = &MMU.BGPAL[attr]) { int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); - lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + ((c1 >> 6))]; - lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; - lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + ((c2 >> 6))]; - lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; - lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; - lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; - lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; - lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + pScn[0] = pBGPAL[(c1 >> 6)]; + pScn[4] = pBGPAL[(c1 >> 2) & 3]; + pScn[1] = pBGPAL[(c2 >> 6)]; + pScn[5] = pBGPAL[(c2 >> 2) & 3]; + pScn[2] = pBGPAL[(c1 >> 4) & 3]; + pScn[6] = pBGPAL[c1 & 3]; + pScn[3] = pBGPAL[(c2 >> 4) & 3]; + pScn[7] = pBGPAL[c2 & 3]; } } else { - lpScreen[pScn + 0] = lpScreen[pScn - 8]; - lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; - lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; - lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; - - lpScreen[pScn + 4] = lpScreen[pScn - 4]; - lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; - lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; - lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; - - BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + *(uint*)(pScn + 0) = *(uint*)(pScn - 8); + *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(pBGw + 0) = *(pBGw - 1); } pScn += 8; pBGw++; @@ -860,17 +840,17 @@ } if ((MMU.PPUREG[1] & PPU_BGCLIP_BIT) == 0 && bLeftClip) { - pScn = lpScanline + 8; + byte* pScn = lpScanline + 8; for (int i = 0; i < 8; i++) { - lpScreen[i] = MMU.BGPAL[0]; + pScn[i] = MMU.BGPAL[0]; } } } // Render sprites var temp = ~PPU_SPMAX_FLAG; - MMU.PPUREG[2] = (byte)(MMU.PPUREG[2] & temp); + MMU.PPUREG[2] &= (byte)(MMU.PPUREG[2] & temp); // 昞帵婜娫奜偱偁傟偽僉儍儞僙儖 if (scanline > 239) @@ -885,145 +865,144 @@ int spraddr = 0, sp_y = 0, sp_h = 0; chr_h = chr_l = 0; - - pBGw = 0; - int pSPw = 0; - int pBit2Rev = 0; - - MemoryUtility.ZEROMEMORY(SPwrite, SPwrite.Length); - - spmax = 0; - Sprite sp = new Sprite(MMU.SPRAM, 0); - sp_h = (MMU.PPUREG[0] & PPU_SP16_BIT) != 0 ? 15 : 7; - - // Left clip - if (bLeftClip && ((MMU.PPUREG[1] & PPU_SPCLIP_BIT) == 0)) + fixed (byte* pBit2Rev = &Bit2Rev[0]) { - SPwrite[0] = 0xFF; - } + byte* pBGw = BGwrite; + byte* pSPw = SPwrite; + Unsafe.InitBlockUnaligned(pSPw, 0, 34); - for (int i = 0; i < 64; i++, sp.AddOffset(1)) - { - sp_y = scanline - (sp.y + 1); - // 僗僉儍儞儔僀儞撪偵SPRITE偑懚嵼偡傞偐傪僠僃僢僋 - if (sp_y != (sp_y & sp_h)) - continue; + spmax = 0; + Sprite sp = new Sprite(MMU.SPRAM, 0); + sp_h = (MMU.PPUREG[0] & PPU_SP16_BIT) != 0 ? 15 : 7; - if ((MMU.PPUREG[0] & PPU_SP16_BIT) == 0) + // Left clip + if (bLeftClip && ((MMU.PPUREG[1] & PPU_SPCLIP_BIT) == 0)) { - // 8x8 Sprite - spraddr = ((MMU.PPUREG[0] & PPU_SPTBL_BIT) << 9) + (sp.tile << 4); - if ((sp.attr & SP_VMIRROR_BIT) == 0) - spraddr += sp_y; - else - spraddr += 7 - sp_y; - } - else - { - // 8x16 Sprite - spraddr = ((sp.tile & 1) << 12) + ((sp.tile & 0xFE) << 4); - if ((sp.attr & SP_VMIRROR_BIT) == 0) - spraddr += ((sp_y & 8) << 1) + (sp_y & 7); - else - spraddr += ((~sp_y & 8) << 1) + (7 - (sp_y & 7)); - } - // Character pattern - chr_l = MMU.PPU_MEM_BANK[spraddr >> 10][spraddr & 0x3FF]; - chr_h = MMU.PPU_MEM_BANK[spraddr >> 10][(spraddr & 0x3FF) + 8]; - - // Character latch(For MMC2/MMC4) - if (bChrLatch) - { - nes.mapper.PPU_ChrLatch((ushort)spraddr); + SPwrite[0] = 0xFF; } - // pattern mask - if ((sp.attr & SP_HMIRROR_BIT) != 0) + for (int i = 0; i < 64; i++, sp.AddOffset(1)) { - chr_l = Bit2Rev[pBit2Rev + chr_l]; - chr_h = Bit2Rev[pBit2Rev + chr_h]; - } - byte SPpat = (byte)(chr_l | chr_h); + sp_y = scanline - (sp.y + 1); + // 僗僉儍儞儔僀儞撪偵SPRITE偑懚嵼偡傞偐傪僠僃僢僋 + if (sp_y != (sp_y & sp_h)) + continue; - // Sprite hitcheck - if (i == 0 && (MMU.PPUREG[2] & PPU_SPHIT_FLAG) == 0) - { - int BGpos = ((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3; - int BGsft = 8 - ((loopy_shift + sp.x) & 7); - - var temp1 = BGwrite[pBGw + BGpos + 0] << 8; - var temp2 = BGwrite[pBGw + BGpos + 1]; - byte BGmsk = (byte)((temp1 | temp2) >> BGsft); - - if ((SPpat & BGmsk) != 0) + if ((MMU.PPUREG[0] & PPU_SP16_BIT) == 0) { - MMU.PPUREG[2] |= PPU_SPHIT_FLAG; + // 8x8 Sprite + spraddr = ((MMU.PPUREG[0] & PPU_SPTBL_BIT) << 9) + (sp.tile << 4); + if ((sp.attr & SP_VMIRROR_BIT) == 0) + spraddr += sp_y; + else + spraddr += 7 - sp_y; + } + else + { + // 8x16 Sprite + spraddr = ((sp.tile & 1) << 12) + ((sp.tile & 0xFE) << 4); + if ((sp.attr & SP_VMIRROR_BIT) == 0) + spraddr += ((sp_y & 8) << 1) + (sp_y & 7); + else + spraddr += ((~sp_y & 8) << 1) + (7 - (sp_y & 7)); + } + // Character pattern + chr_l = MMU.PPU_MEM_BANK[spraddr >> 10][spraddr & 0x3FF]; + chr_h = MMU.PPU_MEM_BANK[spraddr >> 10][(spraddr & 0x3FF) + 8]; + + // Character latch(For MMC2/MMC4) + if (bChrLatch) + { + nes.mapper.PPU_ChrLatch((ushort)spraddr); + } + + // pattern mask + if ((sp.attr & SP_HMIRROR_BIT) != 0) + { + chr_l = pBit2Rev[chr_l]; + chr_h = pBit2Rev[chr_h]; + } + byte SPpat = (byte)(chr_l | chr_h); + + // Sprite hitcheck + if (i == 0 && (MMU.PPUREG[2] & PPU_SPHIT_FLAG) == 0) + { + int BGpos = ((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3; + int BGsft = 8 - ((loopy_shift + sp.x) & 7); + byte BGmsk = (byte)(((pBGw[BGpos + 0] << 8) | pBGw[BGpos + 1]) >> BGsft); + + if ((SPpat & BGmsk) != 0) + { + MMU.PPUREG[2] |= PPU_SPHIT_FLAG; + } + } + + // Sprite mask + int SPpos = sp.x / 8; + int SPsft = 8 - (sp.x & 7); + byte SPmsk = (byte)(((pSPw[SPpos + 0] << 8) | pSPw[SPpos + 1]) >> SPsft); + ushort SPwrt = (ushort)(SPpat << SPsft); + pSPw[SPpos + 0] = (byte)((pSPw[SPpos + 0]) | (SPwrt >> 8)); + pSPw[SPpos + 1] = (byte)((pSPw[SPpos + 1]) | (SPwrt & 0xFF)); + SPpat = (byte)(SPpat & ~SPmsk); + + if ((sp.attr & SP_PRIORITY_BIT) != 0) + { + // BG > SP priority + int BGpos = ((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3; + int BGsft = 8 - ((loopy_shift + sp.x) & 7); + byte BGmsk = (byte)(((pBGw[BGpos + 0] << 8) | pBGw[BGpos + 1]) >> BGsft); + + SPpat = (byte)(SPpat & ~BGmsk); + } + + // Attribute + fixed (byte* pSPPAL = &MMU.SPPAL[(sp.attr & SP_COLOR_BIT) << 2]) + { + // Ptr + byte* pScn = lpScanline + sp.x + 8; + + if (!bExtMono) + { + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + if ((SPpat & 0x80) != 0) pScn[0] = pSPPAL[(c1 >> 6)]; + if ((SPpat & 0x08) != 0) pScn[4] = pSPPAL[(c1 >> 2) & 3]; + if ((SPpat & 0x40) != 0) pScn[1] = pSPPAL[(c2 >> 6)]; + if ((SPpat & 0x04) != 0) pScn[5] = pSPPAL[(c2 >> 2) & 3]; + if ((SPpat & 0x20) != 0) pScn[2] = pSPPAL[(c1 >> 4) & 3]; + if ((SPpat & 0x02) != 0) pScn[6] = pSPPAL[c1 & 3]; + if ((SPpat & 0x10) != 0) pScn[3] = pSPPAL[(c2 >> 4) & 3]; + if ((SPpat & 0x01) != 0) pScn[7] = pSPPAL[c2 & 3]; + } + else + { + // Monocrome effect (for Final Fantasy) + byte mono = BGmono[((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3]; + + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + if ((SPpat & 0x80) != 0) pScn[0] = (byte)(pSPPAL[c1>>6] |mono); + if ((SPpat & 0x08) != 0) pScn[4] = (byte)(pSPPAL[(c1>>2)&3] |mono); + if ((SPpat & 0x40) != 0) pScn[1] = (byte)(pSPPAL[c2>>6] |mono); + if ((SPpat & 0x04) != 0) pScn[5] = (byte)(pSPPAL[(c2>>2)&3] |mono); + if ((SPpat & 0x20) != 0) pScn[2] = (byte)(pSPPAL[(c1>>4)&3] |mono); + if ((SPpat & 0x02) != 0) pScn[6] = (byte)(pSPPAL[c1&3] |mono); + if ((SPpat & 0x10) != 0) pScn[3] = (byte)(pSPPAL[(c2>>4)&3] |mono); + if ((SPpat & 0x01) != 0) pScn[7] = (byte)(pSPPAL[c2 & 3] | mono); + } + } + + if (++spmax > 8 - 1) + { + if (!bMax) + break; } } - - // Sprite mask - int SPpos = sp.x / 8; - int SPsft = 8 - (sp.x & 7); - byte SPmsk = (byte)((SPwrite[pSPw + SPpos + 0] << 8 | SPwrite[pSPw + SPpos + 1]) >> SPsft); - ushort SPwrt = (ushort)(SPpat << SPsft); - SPwrite[pSPw + SPpos + 0] = (byte)(SPwrite[pSPw + SPpos + 0] | SPwrt >> 8); - SPwrite[pSPw + SPpos + 1] = (byte)(SPwrite[pSPw + SPpos + 1] | SPwrt & 0xFF); - SPpat = (byte)(SPpat & ~SPmsk); - - if ((sp.attr & SP_PRIORITY_BIT) != 0) + if (spmax > 8 - 1) { - // BG > SP priority - int BGpos = ((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3; - int BGsft = 8 - ((loopy_shift + sp.x) & 7); - byte BGmsk = (byte)(((BGwrite[pBGw + BGpos + 0] << 8) | BGwrite[pBGw + BGpos + 1]) >> BGsft); - - SPpat = (byte)(SPpat & ~BGmsk); + MMU.PPUREG[2] |= PPU_SPMAX_FLAG; } - - // Attribute - int pSPPAL = (sp.attr & SP_COLOR_BIT) << 2; - // Ptr - pScn = lpScanline + sp.x + 8; - - if (!bExtMono) - { - int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); - int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); - if ((SPpat & 0x80) != 0) lpScreen[pScn + 0] = MMU.SPPAL[pSPPAL + (c1 >> 6)]; - if ((SPpat & 0x08) != 0) lpScreen[pScn + 4] = MMU.SPPAL[pSPPAL + ((c1 >> 2) & 3)]; - if ((SPpat & 0x40) != 0) lpScreen[pScn + 1] = MMU.SPPAL[pSPPAL + ((c2 >> 6))]; - if ((SPpat & 0x04) != 0) lpScreen[pScn + 5] = MMU.SPPAL[pSPPAL + ((c2 >> 2) & 3)]; - if ((SPpat & 0x20) != 0) lpScreen[pScn + 2] = MMU.SPPAL[pSPPAL + ((c1 >> 4) & 3)]; - if ((SPpat & 0x02) != 0) lpScreen[pScn + 6] = MMU.SPPAL[pSPPAL + (c1 & 3)]; - if ((SPpat & 0x10) != 0) lpScreen[pScn + 3] = MMU.SPPAL[pSPPAL + ((c2 >> 4) & 3)]; - if ((SPpat & 0x01) != 0) lpScreen[pScn + 7] = MMU.SPPAL[pSPPAL + (c2 & 3)]; - } - else - { - // Monocrome effect (for Final Fantasy) - byte mono = BGmono[((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3]; - - int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); - int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); - if ((SPpat & 0x80) != 0) lpScreen[pScn + 0] = (byte)(MMU.SPPAL[pSPPAL + (c1 >> 6)] | mono); - if ((SPpat & 0x08) != 0) lpScreen[pScn + 4] = (byte)(MMU.SPPAL[pSPPAL + ((c1 >> 2) & 3)] | mono); - if ((SPpat & 0x40) != 0) lpScreen[pScn + 1] = (byte)(MMU.SPPAL[pSPPAL + (c2 >> 6)] | mono); - if ((SPpat & 0x04) != 0) lpScreen[pScn + 5] = (byte)(MMU.SPPAL[pSPPAL + ((c2 >> 2) & 3)] | mono); - if ((SPpat & 0x20) != 0) lpScreen[pScn + 2] = (byte)(MMU.SPPAL[pSPPAL + ((c1 >> 4) & 3)] | mono); - if ((SPpat & 0x02) != 0) lpScreen[pScn + 6] = (byte)(MMU.SPPAL[pSPPAL + (c1 & 3)] | mono); - if ((SPpat & 0x10) != 0) lpScreen[pScn + 3] = (byte)(MMU.SPPAL[pSPPAL + ((c2 >> 4) & 3)] | mono); - if ((SPpat & 0x01) != 0) lpScreen[pScn + 7] = (byte)(MMU.SPPAL[pSPPAL + (c2 & 3)] | mono); - } - - if (++spmax > 8 - 1) - { - if (!bMax) - break; - } - } - if (spmax > 8 - 1) - { - MMU.PPUREG[2] |= PPU_SPMAX_FLAG; } } @@ -1103,7 +1082,7 @@ MMU.PPUREG[2] |= PPU_VBLANK_FLAG; } - public uint[] GetScreenPtr() + public byte* GetScreenPtr() { return lpScreen; } @@ -1113,9 +1092,10 @@ return lpColormode; } - internal void SetScreenPtr(uint[] screenBuffer, byte[] colormode) + internal void SetScreenPtr(byte[] screenBuffer, byte[] colormode) { - lpScreen = screenBuffer; + lpScreenGCH = GCHandle.Alloc(screenBuffer, GCHandleType.Pinned); + lpScreen = (byte*)lpScreenGCH.AddrOfPinnedObject(); lpColormode = colormode; } From a064078d0df3c5e8eb6239aaddfbfd49373e1f80 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 14 Nov 2024 12:02:11 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E5=AE=8C=E7=BE=8E=E5=83=8F=E7=B4=A0!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scene/AxibugEmuOnline.Client.unity | 4 +- .../Script/NesEmulator/VideoProvider.cs | 16 +---- .../Assets/VirtualNes.Core/NES.cs | 2 +- .../Assets/VirtualNes.Core/PPU.cs | 66 +++++++++++-------- 4 files changed, 43 insertions(+), 45 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity index cbe4d3a..c223490 100644 --- a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity +++ b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity @@ -13413,10 +13413,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} + m_ReferenceResolution: {x: 1920, y: 1080} m_ScreenMatchMode: 0 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs index 0462d4b..6d4196f 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs @@ -12,7 +12,6 @@ namespace AxibugEmuOnline.Client public RawImage Image; - private UInt32[] wrapTexBuffer; private IntPtr wrapTexBufferPointer; private Texture2D wrapTex; private int TexBufferSize; @@ -24,7 +23,7 @@ namespace AxibugEmuOnline.Client DrawCanvas.worldCamera = Camera.main; } - public unsafe void SetDrawData(byte* screenData, byte[] lineColorMode, int screenWidth, int screenHeight) + public unsafe void SetDrawData(uint* screenData, byte[] lineColorMode, int screenWidth, int screenHeight) { if (wrapTex == null) { @@ -32,16 +31,12 @@ namespace AxibugEmuOnline.Client wrapTex = new Texture2D(272, 240, TextureFormat.RGBA32, false); wrapTex.filterMode = FilterMode.Point; - wrapTexBuffer = new uint[screenWidth * screenHeight]; - // ̶飬ֹƶ - GCHandle handle = GCHandle.Alloc(wrapTexBuffer, GCHandleType.Pinned); - // ȡָ - wrapTexBufferPointer = handle.AddrOfPinnedObject(); + wrapTexBufferPointer = (IntPtr)screenData; Image.texture = wrapTex; Image.material.SetTexture("_MainTex", wrapTex); - TexBufferSize = wrapTexBuffer.Length * 4; + TexBufferSize = screenWidth * screenHeight * 4; var palRaw = PaletteDefine.m_cnPalette[0]; pPal = new Texture2D(palRaw.Length, 1, TextureFormat.RGBA32, false); @@ -61,11 +56,6 @@ namespace AxibugEmuOnline.Client Image.material.SetTexture("_PalTex", pPal); } - for (int i = 0; i < wrapTexBuffer.Length; i++) - { - wrapTexBuffer[i] = screenData[i]; - } - wrapTex.LoadRawTextureData(wrapTexBufferPointer, TexBufferSize); wrapTex.Apply(); } diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs index 0be9780..276aa57 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/NES.cs @@ -221,7 +221,7 @@ namespace VirtualNes.Core Debuger.Log("Allocating PPU..."); ppu = new PPU(this); - var screenBuffer = new byte[PPU.SCREEN_WIDTH * PPU.SCREEN_HEIGHT]; + var screenBuffer = new uint[PPU.SCREEN_WIDTH * PPU.SCREEN_HEIGHT]; var colormode = new byte[PPU.SCREEN_HEIGHT]; ppu.SetScreenPtr(screenBuffer, colormode); diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/PPU.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/PPU.cs index d736264..3c7ca00 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/PPU.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/PPU.cs @@ -119,9 +119,9 @@ namespace VirtualNes.Core private ushort loopy_shift; private GCHandle lpScreenGCH; - private byte* lpScreen; + private uint* lpScreen; /// 作为lpScreen数组的索引 - private byte* lpScanline; + private uint* lpScanline; private int ScanlineNo; private byte[] lpColormode; @@ -479,7 +479,7 @@ namespace VirtualNes.Core if (!bExtLatch) { // Without Extension Latch - byte* pScn = lpScanline + (8 - loopy_shift); + uint* pScn = lpScanline + (8 - loopy_shift); byte* pBGw = BGwrite; int tileofs = (MMU.PPUREG[0] & PPU_BGTBL_BIT) << 8; int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); @@ -503,8 +503,8 @@ namespace VirtualNes.Core if (cache_tile == tileadr && cache_attr == attr) { - *(uint*)(pScn + 0) = *(uint*)(pScn - 8); - *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(UInt128*)(pScn + 0) = *(UInt128*)(pScn - 8); + *(UInt128*)(pScn + 4) = *(UInt128*)(pScn - 4); *(pBGw + 0) = *(pBGw - 1); } else @@ -554,7 +554,7 @@ namespace VirtualNes.Core else { // With Extension Latch(For MMC5) - byte* pScn = lpScanline + (8 - loopy_shift); + uint* pScn = lpScanline + (8 - loopy_shift); byte* pBGw = BGwrite; int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); @@ -594,8 +594,8 @@ namespace VirtualNes.Core } else { - *(uint*)(pScn + 0) = *(uint*)(pScn - 8); - *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(UInt128*)(pScn + 0) = *(UInt128*)(pScn - 8); + *(UInt128*)(pScn + 4) = *(UInt128*)(pScn - 4); *(pBGw + 0) = *(pBGw - 1); } pScn += 8; @@ -620,7 +620,7 @@ namespace VirtualNes.Core // Without Extension Latch if (!bExtNameTable) { - byte* pScn = lpScanline + (8 - loopy_shift); + uint* pScn = lpScanline + (8 - loopy_shift); byte* pBGw = BGwrite; int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); @@ -671,8 +671,8 @@ namespace VirtualNes.Core } else { - *(uint*)(pScn + 0) = *(uint*)(pScn - 8); - *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(UInt128*)(pScn + 0) = *(UInt128*)(pScn - 8); + *(UInt128*)(pScn + 4) = *(UInt128*)(pScn - 4); *(pBGw + 0) = *(pBGw - 1); } pScn += 8; @@ -699,7 +699,7 @@ namespace VirtualNes.Core } else { - byte* pScn = lpScanline + (8 - loopy_shift); + uint* pScn = lpScanline + (8 - loopy_shift); byte* pBGw = BGwrite; int ntbladr; @@ -747,8 +747,8 @@ namespace VirtualNes.Core } else { - *(uint*)(pScn + 0) = *(uint*)(pScn - 8); - *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(UInt128*)(pScn + 0) = *(UInt128*)(pScn - 8); + *(UInt128*)(pScn + 4) = *(UInt128*)(pScn - 4); *(pBGw + 0) = *(pBGw - 1); } pScn += 8; @@ -775,7 +775,7 @@ namespace VirtualNes.Core else { // With Extension Latch(For MMC5) - byte* pScn = lpScanline + (8 - loopy_shift); + uint* pScn = lpScanline + (8 - loopy_shift); byte* pBGw = BGwrite; int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); @@ -819,8 +819,8 @@ namespace VirtualNes.Core } else { - *(uint*)(pScn + 0) = *(uint*)(pScn - 8); - *(uint*)(pScn + 4) = *(uint*)(pScn - 4); + *(UInt128*)(pScn + 0) = *(UInt128*)(pScn - 8); + *(UInt128*)(pScn + 4) = *(UInt128*)(pScn - 4); *(pBGw + 0) = *(pBGw - 1); } pScn += 8; @@ -840,7 +840,7 @@ namespace VirtualNes.Core } if ((MMU.PPUREG[1] & PPU_BGCLIP_BIT) == 0 && bLeftClip) { - byte* pScn = lpScanline + 8; + uint* pScn = lpScanline + 8; for (int i = 0; i < 8; i++) { pScn[i] = MMU.BGPAL[0]; @@ -960,7 +960,7 @@ namespace VirtualNes.Core fixed (byte* pSPPAL = &MMU.SPPAL[(sp.attr & SP_COLOR_BIT) << 2]) { // Ptr - byte* pScn = lpScanline + sp.x + 8; + uint* pScn = lpScanline + sp.x + 8; if (!bExtMono) { @@ -982,13 +982,13 @@ namespace VirtualNes.Core int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); - if ((SPpat & 0x80) != 0) pScn[0] = (byte)(pSPPAL[c1>>6] |mono); - if ((SPpat & 0x08) != 0) pScn[4] = (byte)(pSPPAL[(c1>>2)&3] |mono); - if ((SPpat & 0x40) != 0) pScn[1] = (byte)(pSPPAL[c2>>6] |mono); - if ((SPpat & 0x04) != 0) pScn[5] = (byte)(pSPPAL[(c2>>2)&3] |mono); - if ((SPpat & 0x20) != 0) pScn[2] = (byte)(pSPPAL[(c1>>4)&3] |mono); - if ((SPpat & 0x02) != 0) pScn[6] = (byte)(pSPPAL[c1&3] |mono); - if ((SPpat & 0x10) != 0) pScn[3] = (byte)(pSPPAL[(c2>>4)&3] |mono); + if ((SPpat & 0x80) != 0) pScn[0] = (byte)(pSPPAL[c1 >> 6] | mono); + if ((SPpat & 0x08) != 0) pScn[4] = (byte)(pSPPAL[(c1 >> 2) & 3] | mono); + if ((SPpat & 0x40) != 0) pScn[1] = (byte)(pSPPAL[c2 >> 6] | mono); + if ((SPpat & 0x04) != 0) pScn[5] = (byte)(pSPPAL[(c2 >> 2) & 3] | mono); + if ((SPpat & 0x20) != 0) pScn[2] = (byte)(pSPPAL[(c1 >> 4) & 3] | mono); + if ((SPpat & 0x02) != 0) pScn[6] = (byte)(pSPPAL[c1 & 3] | mono); + if ((SPpat & 0x10) != 0) pScn[3] = (byte)(pSPPAL[(c2 >> 4) & 3] | mono); if ((SPpat & 0x01) != 0) pScn[7] = (byte)(pSPPAL[c2 & 3] | mono); } } @@ -1082,7 +1082,7 @@ namespace VirtualNes.Core MMU.PPUREG[2] |= PPU_VBLANK_FLAG; } - public byte* GetScreenPtr() + public uint* GetScreenPtr() { return lpScreen; } @@ -1092,10 +1092,10 @@ namespace VirtualNes.Core return lpColormode; } - internal void SetScreenPtr(byte[] screenBuffer, byte[] colormode) + internal void SetScreenPtr(uint[] screenBuffer, byte[] colormode) { lpScreenGCH = GCHandle.Alloc(screenBuffer, GCHandleType.Pinned); - lpScreen = (byte*)lpScreenGCH.AddrOfPinnedObject(); + lpScreen = (uint*)lpScreenGCH.AddrOfPinnedObject(); lpColormode = colormode; } @@ -1179,4 +1179,12 @@ namespace VirtualNes.Core } } } + + public struct UInt128 + { + public UInt32 a; + public UInt32 b; + public UInt32 c; + public UInt32 d; + } } From 2a846aaf4ef9e0b9c578ee93f641c1739b679ccc Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 14 Nov 2024 14:19:28 +0800 Subject: [PATCH 07/14] =?UTF-8?q?UI=E8=B5=84=E6=BA=90=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Background_Template.prefab | 154 ++++- .../Game_NES_Template.prefab | 155 ++++- .../SubMenuItemTemplates/Room_Template.prefab | 156 ++++- .../SubMenuItemTemplate.prefab | 614 ------------------ .../SubMenuItemTemplate.prefab.meta | 7 - .../BgSetting_ItemTemplate.prefab | 120 +++- .../RomItemTemplate.prefab | 104 ++- .../RoomItemTemplate.prefab | 104 ++- .../Assets/Scene/AxibugEmuOnline.Client.unity | 72 ++ .../UI/BgSettingsUI/BackgroundListMenuItem.cs | 2 - 10 files changed, 798 insertions(+), 690 deletions(-) delete mode 100644 AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/SubMenuItemTemplate.prefab delete mode 100644 AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/SubMenuItemTemplate.prefab.meta diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab index 33d7784..39ff049 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab @@ -30,7 +30,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -72,13 +72,13 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 1 + m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: DESCRIPTION + m_Text: DESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTION --- !u!1 &734025543935719296 GameObject: m_ObjectHideFlags: 0 @@ -395,6 +395,102 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2309024030484972790 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9038541706626733903} + - component: {fileID: 4977539735028594724} + - component: {fileID: 6225050927489615674} + - component: {fileID: 7081002146975090139} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9038541706626733903 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2309024030484972790} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 1 + 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: 4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4977539735028594724 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2309024030484972790} + m_CullTransparentMesh: 1 +--- !u!114 &6225050927489615674 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2309024030484972790} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &7081002146975090139 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2309024030484972790} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &3189920797946144379 GameObject: m_ObjectHideFlags: 0 @@ -445,6 +541,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1ffb0963e9596ce489953bcef1bf3d86, type: 3} m_Name: m_EditorClassIdentifier: + PulseInvoke_Delay: 0.4 + PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} Descript: {fileID: 3380485461544738227} @@ -669,6 +767,7 @@ GameObject: - component: {fileID: 8789823129857705082} - component: {fileID: 3252398029444565139} - component: {fileID: 5331629140490413834} + - component: {fileID: 3731805463351239481} m_Layer: 5 m_Name: InfoNode m_TagString: Untagged @@ -688,6 +787,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6095356919362338847} + - {fileID: 9038541706626733903} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} m_RootOrder: 1 @@ -715,9 +815,9 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 3 - m_Spacing: 0 - m_ChildForceExpandWidth: 0 - m_ChildForceExpandHeight: 1 + m_Spacing: 10 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 @@ -735,6 +835,26 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 +--- !u!114 &3731805463351239481 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3993825260653792697} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 600 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &5340761592919397836 GameObject: m_ObjectHideFlags: 0 @@ -746,6 +866,7 @@ GameObject: - component: {fileID: 6095356919362338847} - component: {fileID: 7651669947470814669} - component: {fileID: 991446423622995247} + - component: {fileID: 2988781737833642094} m_Layer: 5 m_Name: Name m_TagString: Untagged @@ -802,18 +923,33 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 + m_FontSize: 30 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: NAME +--- !u!114 &2988781737833642094 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5340761592919397836} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1.5, y: 1.5} + m_UseGraphicAlpha: 0 --- !u!1 &6164337287601107676 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Game_NES_Template.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Game_NES_Template.prefab index db5e3ac..2b79a81 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Game_NES_Template.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Game_NES_Template.prefab @@ -30,7 +30,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -72,13 +72,13 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 1 + m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: DESCRIPTION + m_Text: DESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTION --- !u!1 &734025543935719296 GameObject: m_ObjectHideFlags: 0 @@ -445,6 +445,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e2f2e38adaa854144b67512333b1b363, type: 3} m_Name: m_EditorClassIdentifier: + PulseInvoke_Delay: 0.4 + PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} Descript: {fileID: 3380485461544738227} @@ -456,6 +458,7 @@ MonoBehaviour: UnSelectScale: 1 RomGroupRoot: {fileID: 3086674949377227884} Platform: 0 + SearchKey: --- !u!114 &5700455559359757662 MonoBehaviour: m_ObjectHideFlags: 0 @@ -670,6 +673,7 @@ GameObject: - component: {fileID: 8789823129857705082} - component: {fileID: 3252398029444565139} - component: {fileID: 5331629140490413834} + - component: {fileID: 5345581584084347406} m_Layer: 5 m_Name: InfoNode m_TagString: Untagged @@ -689,6 +693,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6095356919362338847} + - {fileID: 1559746939363341302} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} m_RootOrder: 1 @@ -716,9 +721,9 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 3 - m_Spacing: 0 - m_ChildForceExpandWidth: 0 - m_ChildForceExpandHeight: 1 + m_Spacing: 10 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 @@ -736,6 +741,26 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 +--- !u!114 &5345581584084347406 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3993825260653792697} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 600 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &5340761592919397836 GameObject: m_ObjectHideFlags: 0 @@ -747,6 +772,7 @@ GameObject: - component: {fileID: 6095356919362338847} - component: {fileID: 7651669947470814669} - component: {fileID: 991446423622995247} + - component: {fileID: 3426362580409509642} m_Layer: 5 m_Name: Name m_TagString: Untagged @@ -803,18 +829,33 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 + m_FontSize: 30 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: NAME +--- !u!114 &3426362580409509642 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5340761592919397836} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1.5, y: 1.5} + m_UseGraphicAlpha: 0 --- !u!1 &6164337287601107676 GameObject: m_ObjectHideFlags: 0 @@ -893,6 +934,102 @@ MonoBehaviour: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 +--- !u!1 &7134041633279784718 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1559746939363341302} + - component: {fileID: 4504230549543102539} + - component: {fileID: 4380995743835436678} + - component: {fileID: 7765129552935136663} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1559746939363341302 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7134041633279784718} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 1 + 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: 4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4504230549543102539 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7134041633279784718} + m_CullTransparentMesh: 1 +--- !u!114 &4380995743835436678 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7134041633279784718} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &7765129552935136663 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7134041633279784718} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &8290338740711049006 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Room_Template.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Room_Template.prefab index c590aab..aa64ea1 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Room_Template.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Room_Template.prefab @@ -30,12 +30,12 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 1 + m_RootOrder: 2 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: 33} + m_SizeDelta: {x: 0, y: 22} m_Pivot: {x: 0, y: 1} --- !u!222 &2718916271043989317 CanvasRenderer: @@ -72,13 +72,13 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 1 + m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: DESCRIPTION + m_Text: DESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTION --- !u!1 &734025543935719296 GameObject: m_ObjectHideFlags: 0 @@ -445,6 +445,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 13190caeb949d3541bfcb2b2f66b5d45, type: 3} m_Name: m_EditorClassIdentifier: + PulseInvoke_Delay: 0.4 + PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} Descript: {fileID: 3380485461544738227} @@ -669,6 +671,7 @@ GameObject: - component: {fileID: 8789823129857705082} - component: {fileID: 3252398029444565139} - component: {fileID: 5331629140490413834} + - component: {fileID: 419995701283403600} m_Layer: 5 m_Name: InfoNode m_TagString: Untagged @@ -688,6 +691,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6095356919362338847} + - {fileID: 15566658635405967} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} m_RootOrder: 1 @@ -715,9 +719,9 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 3 - m_Spacing: 0 - m_ChildForceExpandWidth: 0 - m_ChildForceExpandHeight: 1 + m_Spacing: 10 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 @@ -735,6 +739,26 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 +--- !u!114 &419995701283403600 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3993825260653792697} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 600 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &5340761592919397836 GameObject: m_ObjectHideFlags: 0 @@ -746,6 +770,7 @@ GameObject: - component: {fileID: 6095356919362338847} - component: {fileID: 7651669947470814669} - component: {fileID: 991446423622995247} + - component: {fileID: 378830147916289253} m_Layer: 5 m_Name: Name m_TagString: Untagged @@ -802,18 +827,33 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 + m_FontSize: 30 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: NAME +--- !u!114 &378830147916289253 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5340761592919397836} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1.5, y: 1.5} + m_UseGraphicAlpha: 1 --- !u!1 &6164337287601107676 GameObject: m_ObjectHideFlags: 0 @@ -892,6 +932,102 @@ MonoBehaviour: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 +--- !u!1 &8252035211458221584 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 15566658635405967} + - component: {fileID: 8998367417336585703} + - component: {fileID: 2785619997202574616} + - component: {fileID: 1484108278940983052} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &15566658635405967 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8252035211458221584} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 1 + 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: 4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8998367417336585703 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8252035211458221584} + m_CullTransparentMesh: 1 +--- !u!114 &2785619997202574616 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8252035211458221584} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &1484108278940983052 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8252035211458221584} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &8290338740711049006 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/SubMenuItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/SubMenuItemTemplate.prefab deleted file mode 100644 index 82da6e1..0000000 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/SubMenuItemTemplate.prefab +++ /dev/null @@ -1,614 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &29419265480821815 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8126322204359135913} - - component: {fileID: 2718916271043989317} - - component: {fileID: 3380485461544738227} - m_Layer: 5 - m_Name: Descript - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &8126322204359135913 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 29419265480821815} - 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_Children: [] - m_Father: {fileID: 8789823129857705082} - m_RootOrder: 1 - 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: 33} - m_Pivot: {x: 0, y: 1} ---- !u!222 &2718916271043989317 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 29419265480821815} - m_CullTransparentMesh: 1 ---- !u!114 &3380485461544738227 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 29419265480821815} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 2 - m_MaxSize: 300 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 1 - m_VerticalOverflow: 1 - m_LineSpacing: 1 - m_Text: DESCRIPTION ---- !u!1 &734025543935719296 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1323634865265500141} - - component: {fileID: 5792146190930927166} - - component: {fileID: 2619187604372594158} - - component: {fileID: 1779247868001543556} - - component: {fileID: 4496630961732192070} - - component: {fileID: 2059277597780235898} - m_Layer: 5 - m_Name: shadowIcon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1323634865265500141 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 734025543935719296} - 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_Children: [] - m_Father: {fileID: 6087025893861054323} - 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!222 &5792146190930927166 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 734025543935719296} - m_CullTransparentMesh: 1 ---- !u!114 &2619187604372594158 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 734025543935719296} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 230e155ce0d5a8d4283675d040631efc, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!114 &1779247868001543556 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 734025543935719296} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Version: 300 - m_EffectMaterial: {fileID: 21305736874167728, guid: aee96bc531e6eba468ec405e536f515f, type: 2} - m_EffectFactor: 0 - m_ColorFactor: 0 - m_BlurFactor: 0 - m_EffectMode: 0 - m_ColorMode: 1 - m_BlurMode: 3 - m_AdvancedBlur: 1 - m_ShadowBlur: 1 - m_ShadowStyle: 0 - m_ShadowColor: {r: 0, g: 0, b: 0, a: 1} - m_EffectDistance: {x: 1, y: -1} - m_UseGraphicAlpha: 1 - m_EffectColor: {r: 1, g: 1, b: 1, a: 1} - m_AdditionalShadows: [] ---- !u!114 &4496630961732192070 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 734025543935719296} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0848bff101191904ead4bb831f7084db, type: 3} - m_Name: - m_EditorClassIdentifier: - m_BlurFactor: 1 - m_Style: 3 - m_AdditionalShadows: [] - m_EffectColor: {r: 1, g: 1, b: 1, a: 0} - m_EffectDistance: {x: 8, y: 8} - m_UseGraphicAlpha: 0 ---- !u!95 &2059277597780235898 -Animator: - serializedVersion: 3 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 734025543935719296} - m_Enabled: 1 - m_Avatar: {fileID: 0} - m_Controller: {fileID: 9100000, guid: 0b3ccf7414d2ead43be0cd33b6e1b53c, type: 2} - m_CullingMode: 0 - m_UpdateMode: 0 - m_ApplyRootMotion: 0 - m_LinearVelocityBlending: 0 - m_WarningMessage: - m_HasTransformHierarchy: 1 - m_AllowConstantClipSamplingOptimization: 1 - m_KeepAnimatorControllerStateOnDisable: 0 ---- !u!1 &1776357407830023228 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6087025893861054323} - - component: {fileID: 7036072602178187444} - - component: {fileID: 6771349210554360888} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6087025893861054323 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1776357407830023228} - 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_Children: - - {fileID: 1323634865265500141} - m_Father: {fileID: 8754483333502849411} - 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: 144, y: 104} - m_Pivot: {x: 1, y: 0.5} ---- !u!222 &7036072602178187444 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1776357407830023228} - m_CullTransparentMesh: 1 ---- !u!114 &6771349210554360888 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1776357407830023228} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 230e155ce0d5a8d4283675d040631efc, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &3189920797946144379 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1998281097548910301} - - component: {fileID: 2502609279043838113} - - component: {fileID: 5700455559359757662} - m_Layer: 5 - m_Name: SubMenuItemTemplate - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1998281097548910301 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3189920797946144379} - 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_Children: - - {fileID: 8754483333502849411} - m_Father: {fileID: 0} - m_RootOrder: 0 - 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: 144, y: 104} - m_Pivot: {x: 0, y: 0.5} ---- !u!114 &2502609279043838113 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3189920797946144379} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8e5baf5f72cf1954196a3a0346c2b1be, type: 3} - m_Name: - m_EditorClassIdentifier: - Icon: {fileID: 6771349210554360888} - Txt: {fileID: 991446423622995247} - Descript: {fileID: 3380485461544738227} - Root: {fileID: 8754483333502849411} - ShadowIcon: {fileID: 2619187604372594158} - InfoNode: {fileID: 2621205976727769389} - SubMenuItemGroup: {fileID: 0} - SelectScale: 1 - UnSelectScale: 1 ---- !u!114 &5700455559359757662 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3189920797946144379} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreLayout: 0 - m_MinWidth: -1 - m_MinHeight: -1 - m_PreferredWidth: 200 - m_PreferredHeight: 230 - m_FlexibleWidth: -1 - m_FlexibleHeight: -1 - m_LayoutPriority: 1 ---- !u!1 &3993825260653792697 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8789823129857705082} - - component: {fileID: 3252398029444565139} - - component: {fileID: 4972426757569440742} - - component: {fileID: 2621205976727769389} - m_Layer: 5 - m_Name: InfoNode - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &8789823129857705082 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3993825260653792697} - 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_Children: - - {fileID: 6095356919362338847} - - {fileID: 8126322204359135913} - m_Father: {fileID: 8754483333502849411} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 144, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0.5} ---- !u!114 &3252398029444565139 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3993825260653792697} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 20 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 3 - m_Spacing: 0 - m_ChildForceExpandWidth: 0 - m_ChildForceExpandHeight: 1 - m_ChildControlWidth: 1 - m_ChildControlHeight: 0 - m_ChildScaleWidth: 0 - m_ChildScaleHeight: 0 - m_ReverseArrangement: 0 ---- !u!114 &4972426757569440742 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3993825260653792697} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalFit: 2 - m_VerticalFit: 2 ---- !u!225 &2621205976727769389 -CanvasGroup: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3993825260653792697} - m_Enabled: 1 - m_Alpha: 1 - m_Interactable: 1 - m_BlocksRaycasts: 1 - m_IgnoreParentGroups: 0 ---- !u!1 &5340761592919397836 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6095356919362338847} - - component: {fileID: 7651669947470814669} - - component: {fileID: 991446423622995247} - m_Layer: 5 - m_Name: Name - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6095356919362338847 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5340761592919397836} - 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_Children: [] - m_Father: {fileID: 8789823129857705082} - 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: 33} - m_Pivot: {x: 0, y: 1} ---- !u!222 &7651669947470814669 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5340761592919397836} - m_CullTransparentMesh: 1 ---- !u!114 &991446423622995247 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5340761592919397836} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 2 - m_MaxSize: 300 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 1 - m_VerticalOverflow: 1 - m_LineSpacing: 1 - m_Text: NAME ---- !u!1 &8290338740711049006 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8754483333502849411} - - component: {fileID: 7558693960475443325} - m_Layer: 5 - m_Name: Root - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &8754483333502849411 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8290338740711049006} - 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_Children: - - {fileID: 6087025893861054323} - - {fileID: 8789823129857705082} - m_Father: {fileID: 1998281097548910301} - 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 &7558693960475443325 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8290338740711049006} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 3 - m_Spacing: 0 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 1 - m_ChildControlWidth: 0 - m_ChildControlHeight: 0 - m_ChildScaleWidth: 0 - m_ChildScaleHeight: 0 - m_ReverseArrangement: 0 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/SubMenuItemTemplate.prefab.meta b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/SubMenuItemTemplate.prefab.meta deleted file mode 100644 index ceb83f9..0000000 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/SubMenuItemTemplate.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 01f3c5497992f944eae9b9efa15a19c2 -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab index e76c41b..c32b755 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab @@ -30,7 +30,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -72,13 +72,13 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 3 + m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 1 + m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 111111111111111111111111111111111111111111 + m_Text: DESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTION --- !u!1 &734025543935719296 GameObject: m_ObjectHideFlags: 0 @@ -629,6 +629,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f287ccd26d5f14b46b7afb8912daa2e8, type: 3} m_Name: m_EditorClassIdentifier: + PulseInvoke_Delay: 0.4 + PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} Descript: {fileID: 3380485461544738227} @@ -670,15 +672,16 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6095356919362338847} + - {fileID: 6797116381500671839} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} 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: 494.04688, y: 0} - m_SizeDelta: {x: 588.0938, y: 0} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 200, y: 0} + m_SizeDelta: {x: 600, y: 0} + m_Pivot: {x: 0, y: 0.5} --- !u!114 &3252398029444565139 MonoBehaviour: m_ObjectHideFlags: 0 @@ -697,9 +700,9 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 3 - m_Spacing: 0 - m_ChildForceExpandWidth: 0 - m_ChildForceExpandHeight: 1 + m_Spacing: 10 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 @@ -844,6 +847,7 @@ GameObject: - component: {fileID: 6095356919362338847} - component: {fileID: 7651669947470814669} - component: {fileID: 991446423622995247} + - component: {fileID: 8545526122445709124} m_Layer: 5 m_Name: Name m_TagString: Untagged @@ -900,18 +904,33 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 + m_FontSize: 30 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: NAME +--- !u!114 &8545526122445709124 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5340761592919397836} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1.5, y: 1.5} + m_UseGraphicAlpha: 1 --- !u!1 &5537066628246125853 GameObject: m_ObjectHideFlags: 0 @@ -1076,6 +1095,81 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &6688216270065609628 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6797116381500671839} + - component: {fileID: 5682159953164052307} + - component: {fileID: 4812759387377418448} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6797116381500671839 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6688216270065609628} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 1 + 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: 4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5682159953164052307 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6688216270065609628} + m_CullTransparentMesh: 1 +--- !u!114 &4812759387377418448 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6688216270065609628} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &8290338740711049006 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RomItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RomItemTemplate.prefab index 68cecaa..e73dfa6 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RomItemTemplate.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RomItemTemplate.prefab @@ -30,7 +30,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -72,13 +72,13 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 3 + m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 1 + m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 111111111111111111111111111111111111111111 + m_Text: DESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTION --- !u!1 &734025543935719296 GameObject: m_ObjectHideFlags: 0 @@ -559,6 +559,81 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -10, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &3095305487988041719 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3242981749023616473} + - component: {fileID: 8396022999709437079} + - component: {fileID: 72627194734755216} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3242981749023616473 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3095305487988041719} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 1 + 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: 4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8396022999709437079 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3095305487988041719} + m_CullTransparentMesh: 1 +--- !u!114 &72627194734755216 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3095305487988041719} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &3189920797946144379 GameObject: m_ObjectHideFlags: 0 @@ -609,6 +684,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f236de3ffaafd4149a3b7395e05b8d07, type: 3} m_Name: m_EditorClassIdentifier: + PulseInvoke_Delay: 0.4 + PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} Descript: {fileID: 3380485461544738227} @@ -674,15 +751,16 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6095356919362338847} + - {fileID: 3242981749023616473} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} 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: 494.04688, y: 0} - m_SizeDelta: {x: 588.0938, y: 0} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 200, y: 0} + m_SizeDelta: {x: 600, y: 0} + m_Pivot: {x: 0, y: 0.5} --- !u!114 &3252398029444565139 MonoBehaviour: m_ObjectHideFlags: 0 @@ -701,9 +779,9 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 3 - m_Spacing: 0 - m_ChildForceExpandWidth: 0 - m_ChildForceExpandHeight: 1 + m_Spacing: 20 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 @@ -904,12 +982,12 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 + m_FontSize: 30 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab index 0b57bd7..6334c42 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab @@ -30,7 +30,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -72,13 +72,13 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 3 + m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 1 + m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 111111111111111111111111111111111111111111 + m_Text: DESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTION --- !u!1 &734025543935719296 GameObject: m_ObjectHideFlags: 0 @@ -609,6 +609,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 321002db0a5429f4da7529d85c93799c, type: 3} m_Name: m_EditorClassIdentifier: + PulseInvoke_Delay: 0.4 + PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} Descript: {fileID: 3380485461544738227} @@ -674,15 +676,16 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6095356919362338847} + - {fileID: 2553088066574421578} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} 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: 494.04688, y: 0} - m_SizeDelta: {x: 588.0938, y: 0} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 200, y: 0} + m_SizeDelta: {x: 600, y: 0} + m_Pivot: {x: 0, y: 0.5} --- !u!114 &3252398029444565139 MonoBehaviour: m_ObjectHideFlags: 0 @@ -701,9 +704,9 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 3 - m_Spacing: 0 - m_ChildForceExpandWidth: 0 - m_ChildForceExpandHeight: 1 + m_Spacing: 20 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 @@ -904,12 +907,12 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 + m_FontSize: 30 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 300 - m_Alignment: 4 + m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 @@ -1080,6 +1083,81 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &8170896731725291133 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2553088066574421578} + - component: {fileID: 1124836261947575846} + - component: {fileID: 1135952883384385484} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2553088066574421578 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8170896731725291133} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 1 + 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: 4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1124836261947575846 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8170896731725291133} + m_CullTransparentMesh: 1 +--- !u!114 &1135952883384385484 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8170896731725291133} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &8290338740711049006 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity index c223490..14f2e72 100644 --- a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity +++ b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity @@ -1733,6 +1733,10 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 1123216300666504885, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 1123216300666504885, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -1765,6 +1769,26 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 1213768548549575027, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1213768548549575027, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1213768548549575027, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1213768548549575027, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1213768548549575027, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 1214192838935812026, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -3285,6 +3309,10 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 2121489158276826261, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} - target: {fileID: 2121489158276826261, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -4821,6 +4849,10 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 3154498213895607299, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 3154498213895607299, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -9797,6 +9829,26 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 6572498292253760549, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6572498292253760549, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6572498292253760549, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6572498292253760549, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6572498292253760549, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 6572539113524258689, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -11013,6 +11065,26 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 7478698004572970772, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7478698004572970772, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7478698004572970772, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7478698004572970772, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7478698004572970772, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7479336768543096127, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_AnchorMax.y value: 0 diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs index 19e8d89..7a66c85 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs @@ -1,5 +1,3 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.Event; using System; namespace AxibugEmuOnline.Client From 4ca053f62447aa3b07910584182759eded540b16 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 14 Nov 2024 17:14:52 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Resources/Materials.meta | 8 + .../Materials}/XMBBackGround.mat | 2 +- .../Materials}/XMBBackGround.mat.meta | 0 .../Materials/XMBBackGroundPreview.mat | 53 ++ .../Materials/XMBBackGroundPreview.mat.meta | 8 + .../Resources/UIPrefabs/LaunchUI.prefab | 16 +- .../Resources/UIPrefabs/OptionUI.prefab | 6 +- .../Background_Template.prefab | 17 +- ...ab => BgSetting_Color_ItemTemplate.prefab} | 454 +----------------- ... BgSetting_Color_ItemTemplate.prefab.meta} | 0 AxibugEmuOnline.Client/Assets/Script/App.cs | 9 +- .../Assets/Script/Manager/AppSceneLoader.cs | 89 ---- .../Assets/Script/Manager/AppSettings.meta | 8 + .../Script/Manager/AppSettings/AppSettings.cs | 8 + .../AppSettings.cs.meta} | 2 +- .../Manager/AppSettings/BgColorSettings.cs | 72 +++ .../AppSettings/BgColorSettings.cs.meta | 11 + .../UI/BgSettingsUI/BackgroundListMenuItem.cs | 8 +- .../Script/UI/BgSettingsUI/BgSettingItem.cs | 21 - .../Script/UI/BgSettingsUI/BgSetting_Color.cs | 80 +++ ...ngItem.cs.meta => BgSetting_Color.cs.meta} | 0 .../UI/BgSettingsUI/SettingItemSelector.cs | 13 + .../BgSettingsUI/SettingItemSelector.cs.meta | 11 + .../UI/CommandDispatcher/CommandExcuter.cs | 2 - .../Script/UI/ItemPresent/ItemPresent.cs | 13 +- .../Assets/Script/UI/ItemPresent/ItemProxy.cs | 14 +- .../Script/UI/ItemPresent/ItemSelector.cs | 16 + .../UI/ItemPresent/ItemSelector.cs.meta | 11 + .../Assets/Script/UI/OptionUI/OptionUI.cs | 27 +- .../UI/OptionUI/OptionUI_ExecuteItem.cs | 4 - .../Script/UI/OptionUI/OptionUI_MenuItem.cs | 15 +- .../Assets/Script/UI/UITool.cs | 33 ++ .../Assets/Script/UI/UITool.cs.meta | 11 + .../Script/UI/XMBBackGroundPreview.shader | 190 ++++++++ .../UI/XMBBackGroundPreview.shader.meta | 10 + .../Assets/Script/UI/XMBBgChanger.cs | 33 ++ .../Assets/Script/UI/XMBBgChanger.cs.meta | 11 + 37 files changed, 690 insertions(+), 596 deletions(-) create mode 100644 AxibugEmuOnline.Client/Assets/Resources/Materials.meta rename AxibugEmuOnline.Client/Assets/{Script/UI => Resources/Materials}/XMBBackGround.mat (96%) rename AxibugEmuOnline.Client/Assets/{Script/UI => Resources/Materials}/XMBBackGround.mat.meta (100%) create mode 100644 AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGroundPreview.mat create mode 100644 AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGroundPreview.mat.meta rename AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/{BgSetting_ItemTemplate.prefab => BgSetting_Color_ItemTemplate.prefab} (63%) rename AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/{BgSetting_ItemTemplate.prefab.meta => BgSetting_Color_ItemTemplate.prefab.meta} (100%) delete mode 100644 AxibugEmuOnline.Client/Assets/Script/Manager/AppSceneLoader.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs rename AxibugEmuOnline.Client/Assets/Script/Manager/{AppSceneLoader.cs.meta => AppSettings/AppSettings.cs.meta} (83%) create mode 100644 AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs.meta delete mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSettingItem.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs rename AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/{BgSettingItem.cs.meta => BgSetting_Color.cs.meta} (100%) create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader.meta create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Resources/Materials.meta b/AxibugEmuOnline.Client/Assets/Resources/Materials.meta new file mode 100644 index 0000000..07e2829 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c10da27661263d4d91d515ca5a3a0e2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.mat b/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGround.mat similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.mat rename to AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGround.mat index a7ed85f..f4174e5 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.mat +++ b/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGround.mat @@ -49,5 +49,5 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - _Color1: {r: 0, g: 0.4, b: 1, a: 1} - - _Color2: {r: 0, g: 0.7, b: 1, a: 1} + - _Color2: {r: 0, g: 0.69803923, b: 1, a: 1} m_BuildTextureStacks: [] diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.mat.meta b/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGround.mat.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.mat.meta rename to AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGround.mat.meta diff --git a/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGroundPreview.mat b/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGroundPreview.mat new file mode 100644 index 0000000..4579367 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGroundPreview.mat @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: XMBBackGroundPreview + m_Shader: {fileID: 4800000, guid: 424d88aff12857f4aab1911fdb6e02e9, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _ColorMask: 15 + - _Frequency1: 2 + - _Frequency2: 2.1 + - _MaxHeight1: 0.5 + - _MaxHeight2: 0.54 + - _MidHeight1: 0.4 + - _MidHeight2: 0.42 + - _Power1: 50 + - _Power2: 50 + - _Speed1: 0.4 + - _Speed2: 0.3 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UseUIAlphaClip: 0 + - _WaveFrequency1: 4 + - _WaveMaxHeight1: 0.02 + - _WaveMidHeight1: 0 + - _WaveSpd1: 0.02 + - _WaveX1: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color1: {r: 0, g: 0.4, b: 1, a: 1} + - _Color2: {r: 0, g: 0.69803923, b: 1, a: 1} + m_BuildTextureStacks: [] diff --git a/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGroundPreview.mat.meta b/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGroundPreview.mat.meta new file mode 100644 index 0000000..a9ac198 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/Materials/XMBBackGroundPreview.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd41a1a4bc40bb240866d8e33adfa66f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/LaunchUI.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/LaunchUI.prefab index 69341ef..df74286 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/LaunchUI.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/LaunchUI.prefab @@ -85,8 +85,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fb4f275956ba18440b061e92278f13cd, type: 3} m_Name: m_EditorClassIdentifier: - PulseInvoke_Delay: 0.4 - PulseInvoke_Interval: 0.05 m_menuItemRoot: {fileID: 7102897325704768026} GroupRoot: {fileID: 5247317738185020566} Template: {fileID: 2502609279043838113, guid: ece591129eb9bcc48bd83ec153c98018, type: 3} @@ -134,6 +132,7 @@ GameObject: - component: {fileID: 1639091783724093883} - component: {fileID: 1639091783724093861} - component: {fileID: 1639091783724093860} + - component: {fileID: 3473513813641582791} m_Layer: 5 m_Name: bg m_TagString: Untagged @@ -198,6 +197,19 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &3473513813641582791 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1639091783724093882} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 34f3a870b3a425c4daead53193dcd9c2, type: 3} + m_Name: + m_EditorClassIdentifier: + imgUI: {fileID: 1639091783724093860} --- !u!1 &1639091784002085451 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab index 8cef0dd..6b39fd6 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab @@ -375,8 +375,8 @@ MonoBehaviour: m_Padding: m_Left: 20 m_Right: 20 - m_Top: 20 - m_Bottom: 20 + m_Top: 10 + m_Bottom: 10 m_ChildAlignment: 3 m_Spacing: 12 m_ChildForceExpandWidth: 0 @@ -550,8 +550,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d9077edba700447499a21395109542df, type: 3} m_Name: m_EditorClassIdentifier: - PulseInvoke_Delay: 0.4 - PulseInvoke_Interval: 0.05 MenuRoot: {fileID: 5397686940312333149} SelectBorder: {fileID: 2404013603202822047} TEMPLATE_EXECUTEITEM: {fileID: 3721725547312714320} diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab index 39ff049..43c10b3 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab @@ -961,6 +961,7 @@ GameObject: - component: {fileID: 8865437771338118001} - component: {fileID: 6055880809428073973} - component: {fileID: 1286529697012677180} + - component: {fileID: 1434074089467284101} m_Layer: 5 m_Name: SettingGroup m_TagString: Untagged @@ -1011,7 +1012,7 @@ MonoBehaviour: m_Spacing: {x: 0, y: 20} m_Constraint: 1 m_ConstraintCount: 1 - ItemTemplate: {fileID: 1998281097548910301, guid: 2e8fa6342641dc4418cd5c71f89d112c, type: 3} + ItemTemplate: {fileID: 0} ViewRect: {fileID: 2303118795734916657} PauseUpdateView: 0 --- !u!114 &1286529697012677180 @@ -1028,6 +1029,20 @@ MonoBehaviour: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 +--- !u!114 &1434074089467284101 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6164337287601107676} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6e7f64bad63ce024eadbd9ddff940eee, type: 3} + m_Name: + m_EditorClassIdentifier: + ItemList: + - {fileID: 1998281097548910301, guid: 2e8fa6342641dc4418cd5c71f89d112c, type: 3} --- !u!1 &8290338740711049006 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab similarity index 63% rename from AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab rename to AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab index c32b755..547e210 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab @@ -114,11 +114,11 @@ RectTransform: m_Father: {fileID: 8754483333502849411} 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: -150, y: 0} - m_SizeDelta: {x: -296, y: 4} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0, y: 0.5} --- !u!222 &5792146190930927166 CanvasRenderer: m_ObjectHideFlags: 0 @@ -222,157 +222,6 @@ Animator: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorControllerStateOnDisable: 0 ---- !u!1 &1252956242765037133 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 88397014911048519} - - component: {fileID: 3360692256366003092} - - component: {fileID: 6259552039526853317} - m_Layer: 5 - m_Name: Downloading - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &88397014911048519 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1252956242765037133} - 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_Children: - - {fileID: 1356745056984945386} - m_Father: {fileID: 8105925540140519754} - 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!222 &3360692256366003092 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1252956242765037133} - m_CullTransparentMesh: 1 ---- !u!114 &6259552039526853317 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1252956242765037133} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 0.53333336} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &1760891290906570025 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7286174480513024547} - - component: {fileID: 8465840075520521938} - - component: {fileID: 5960295925543634495} - m_Layer: 5 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &7286174480513024547 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1760891290906570025} - 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_Children: [] - m_Father: {fileID: 1356745056984945386} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.25} - m_AnchorMax: {x: 1, y: 0.75} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &8465840075520521938 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1760891290906570025} - m_CullTransparentMesh: 1 ---- !u!114 &5960295925543634495 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1760891290906570025} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.6556604, g: 0.8499731, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 --- !u!1 &1776357407830023228 GameObject: m_ObjectHideFlags: 0 @@ -430,7 +279,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: fd41a1a4bc40bb240866d8e33adfa66f, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} @@ -438,7 +287,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 0} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 0 @@ -448,117 +297,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!1 &2160152188869765819 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8088221278067224827} - - component: {fileID: 7021285932952529020} - - component: {fileID: 373824653597363199} - m_Layer: 5 - m_Name: Fill - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &8088221278067224827 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2160152188869765819} - 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_Children: [] - m_Father: {fileID: 4825215963562112837} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 10, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &7021285932952529020 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2160152188869765819} - m_CullTransparentMesh: 1 ---- !u!114 &373824653597363199 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2160152188869765819} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0, g: 0.39235067, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &2807279088801569631 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4825215963562112837} - m_Layer: 5 - m_Name: Fill Area - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &4825215963562112837 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2807279088801569631} - 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_Children: - - {fileID: 8088221278067224827} - m_Father: {fileID: 1356745056984945386} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.25} - m_AnchorMax: {x: 1, y: 0.75} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -10, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &3189920797946144379 GameObject: m_ObjectHideFlags: 0 @@ -571,7 +309,7 @@ GameObject: - component: {fileID: 5700455559359757662} - component: {fileID: -3212218113140324734} m_Layer: 5 - m_Name: BgSetting_ItemTemplate + m_Name: BgSetting_Color_ItemTemplate m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -595,7 +333,7 @@ RectTransform: 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: 500, y: 200} + m_SizeDelta: {x: 500, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &5700455559359757662 MonoBehaviour: @@ -629,8 +367,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f287ccd26d5f14b46b7afb8912daa2e8, type: 3} m_Name: m_EditorClassIdentifier: - PulseInvoke_Delay: 0.4 - PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} Descript: {fileID: 3380485461544738227} @@ -679,7 +415,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 200, y: 0} + m_AnchoredPosition: {x: 100, y: 0} m_SizeDelta: {x: 600, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &3252398029444565139 @@ -788,15 +524,13 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6087025893861054323} - - {fileID: 1361359478345282377} - - {fileID: 88397014911048519} m_Father: {fileID: 8754483333502849411} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 200, y: 200} + m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0, y: 0.5} --- !u!222 &1377401926964550360 CanvasRenderer: @@ -819,7 +553,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 0} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -931,170 +665,6 @@ MonoBehaviour: m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} m_EffectDistance: {x: 1.5, y: 1.5} m_UseGraphicAlpha: 1 ---- !u!1 &5537066628246125853 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1356745056984945386} - - component: {fileID: 1484915906009859069} - m_Layer: 5 - m_Name: Slider - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1356745056984945386 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5537066628246125853} - 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_Children: - - {fileID: 7286174480513024547} - - {fileID: 4825215963562112837} - m_Father: {fileID: 88397014911048519} - m_RootOrder: 0 - 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.0001} - m_SizeDelta: {x: 160, y: 68.2756} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1484915906009859069 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5537066628246125853} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 0 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 0 - m_TargetGraphic: {fileID: 0} - m_FillRect: {fileID: 8088221278067224827} - m_HandleRect: {fileID: 0} - m_Direction: 0 - m_MinValue: 0 - m_MaxValue: 1 - m_WholeNumbers: 0 - m_Value: 0 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &6316945668089981796 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1361359478345282377} - - component: {fileID: 1381140245428399030} - - component: {fileID: 7474552512404188589} - m_Layer: 5 - m_Name: RomReady - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &1361359478345282377 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6316945668089981796} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 8105925540140519754} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -12, y: -21} - m_SizeDelta: {x: 48.3195, y: 40.7695} - m_Pivot: {x: 1, y: 1} ---- !u!222 &1381140245428399030 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6316945668089981796} - m_CullTransparentMesh: 1 ---- !u!114 &7474552512404188589 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6316945668089981796} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0, g: 0.22587347, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 734113830533174147, guid: d518d00d4940e854bbe45d9ef891401a, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 --- !u!1 &6688216270065609628 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab.meta b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_ItemTemplate.prefab.meta rename to AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/App.cs b/AxibugEmuOnline.Client/Assets/Script/App.cs index 9f0994f..6ec7b73 100644 --- a/AxibugEmuOnline.Client/Assets/Script/App.cs +++ b/AxibugEmuOnline.Client/Assets/Script/App.cs @@ -25,9 +25,8 @@ namespace AxibugEmuOnline.Client.ClientCore public static RomLib nesRomLib; public static HttpAPI httpAPI; public static CacheManager CacheMgr; - public static AppSceneLoader SceneLoader; public static AppRoom roomMgr; - + public static AppSettings settings; #region Mono public static TickLoop tickLoop; private static CoroutineRunner coRunner; @@ -39,9 +38,11 @@ namespace AxibugEmuOnline.Client.ClientCore public static string PersistentDataPath => Application.persistentDataPath; #endif - [RuntimeInitializeOnLoadMethod] + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)] static void Init() { + settings = new AppSettings(); + log = new LogManager(); LogManager.OnLog += OnNoSugarNetLog; network = new NetworkHelper(); @@ -53,9 +54,7 @@ namespace AxibugEmuOnline.Client.ClientCore httpAPI = new HttpAPI(); nesRomLib = new RomLib(EnumPlatform.NES); CacheMgr = new CacheManager(); - SceneLoader = new AppSceneLoader(); roomMgr = new AppRoom(); - var go = new GameObject("[AppAxibugEmuOnline]"); GameObject.DontDestroyOnLoad(go); tickLoop = go.AddComponent(); diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSceneLoader.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSceneLoader.cs deleted file mode 100644 index 8bea1f0..0000000 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSceneLoader.cs +++ /dev/null @@ -1,89 +0,0 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; - -namespace AxibugEmuOnline.Client -{ - public class AppSceneLoader - { - public LoadTask CurrentTask { get; private set; } - - Queue m_tasks = new Queue(); - Coroutine m_coroutine; - public void BeginLoad(string scenePath, Action callback) - { - m_tasks.Enqueue(new LoadTask(scenePath, callback)); - if (m_coroutine == null) - m_coroutine = App.StartCoroutine(TaskFlow()); - } - - private IEnumerator TaskFlow() - { - while (m_tasks.Count > 0) - { - CurrentTask = m_tasks.Dequeue(); - - while (CurrentTask.MoveNext()) yield return null; - - CurrentTask.Callback(); - } - - CurrentTask = null; - m_coroutine = null; - } - - public class LoadTask - { - public EnumTaskState State { get; private set; } = EnumTaskState.Idle; - public float Progress => m_loadingOp != null ? m_loadingOp.progress : 0; - - private AsyncOperation m_loadingOp; - private string m_scenePath; - private Action m_callback; - public LoadTask(string scenePath, Action callback) - { - m_scenePath = scenePath; - m_callback = callback; - } - - public bool MoveNext() - { - if (State == EnumTaskState.Idle) - { - State = EnumTaskState.Running; - m_loadingOp = SceneManager.LoadSceneAsync(m_scenePath, LoadSceneMode.Single); - return true; - } - else if (State == EnumTaskState.Running) - { - m_loadingOp.allowSceneActivation = true; - if (m_loadingOp.isDone) - { - State = EnumTaskState.Complete; - } - - return true; - } - else - { - return false; - } - } - - public void Callback() - { - m_callback?.Invoke(); - } - } - - public enum EnumTaskState - { - Idle, - Running, - Complete - } - } -} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings.meta b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings.meta new file mode 100644 index 0000000..df05012 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 978f10f110fddd548b3f110c5e700a58 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs new file mode 100644 index 0000000..7816fb6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs @@ -0,0 +1,8 @@ +namespace AxibugEmuOnline.Client +{ + public class AppSettings + { + /// 背景颜色设定 + public BgColorSettings BgColor { get; set; } = new BgColorSettings(); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSceneLoader.cs.meta b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs.meta similarity index 83% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppSceneLoader.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs.meta index e9929a3..4a107e4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSceneLoader.cs.meta +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 31fee02299bfd5141aefb2bbfb0555a9 +guid: f3173e9925c703b4aa648e7e65ac4260 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs new file mode 100644 index 0000000..a29d8fd --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class BgColorSettings + { + public delegate void OnColorChangedHandle(XMBColor color); + public event OnColorChangedHandle OnColorChanged; + + /// 当前颜色 + public XMBColor CurrentColor + { + get + { + var color1 = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color1)}", null); + var color2 = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color2)}", null); + var name = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.Name)}", null); + if (color1 == null || color2 == null || name == null) + return DEFAULT; + else + return new XMBColor(name, color1, color2); + } + set + { + PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color1)}", $"#{ColorUtility.ToHtmlStringRGB(value.color1)}"); + PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color2)}", $"#{ColorUtility.ToHtmlStringRGB(value.color2)}"); + PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.Name)}", value.Name); + + OnColorChanged?.Invoke(value); + } + } + + private static readonly XMBColor DEFAULT = new XMBColor("蓝", "#020754", "#0ab1dc"); + public List Presets { get; private set; } = new List() + { + DEFAULT, + new XMBColor("白","#8a9fb2","#4e9eb6"), + new XMBColor("黄","#d5a916","#d1a813"), + new XMBColor("绿","#3e962b","#7ac25e"), + new XMBColor("粉","#e65a8b","#c7acc6"), + new XMBColor("墨绿","#00421a","#1c951f"), + new XMBColor("紫","#633f93","#8763cc"), + new XMBColor("天蓝","#038baa","#0ca2c2"), + new XMBColor("红","#9c120e","#d73611"), + }; + } + + + public struct XMBColor + { + public string Name; + public Color color1; + public Color color2; + + public XMBColor(string name, string colorCodeStr1, string colorCodeStr2) + { + Name = name; + ColorUtility.TryParseHtmlString(colorCodeStr1, out color1); + ColorUtility.TryParseHtmlString(colorCodeStr2, out color2); + } + + public override int GetHashCode() + { + int hash = 17; + hash = hash * 23 + (Name != null ? Name.GetHashCode() : 0); + hash = hash * 23 + color1.GetHashCode(); + hash = hash * 23 + color2.GetHashCode(); + return hash; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs.meta b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs.meta new file mode 100644 index 0000000..f94dc42 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 84a76f8dddc2a6045bb73b2ee9887cd3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs index 7a66c85..4cff095 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs @@ -1,4 +1,6 @@ +using AxibugEmuOnline.Client.ClientCore; using System; +using System.Collections.Generic; namespace AxibugEmuOnline.Client { @@ -6,7 +8,11 @@ namespace AxibugEmuOnline.Client { protected override void GetVirtualListDatas(Action datas) { - return; + List list = new List() + { + App.settings.BgColor, + }; + datas.Invoke(list); } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSettingItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSettingItem.cs deleted file mode 100644 index d7d8026..0000000 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSettingItem.cs +++ /dev/null @@ -1,21 +0,0 @@ -using AxibugEmuOnline.Client.UI; - -namespace AxibugEmuOnline.Client -{ - public class BgSettingItem : MenuItem, IVirtualItem - { - public int Index { get; set; } - - public void SetData(object data) - { - } - - public void SetDependencyProperty(object data) - { - } - - public void Release() - { - } - } -} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs new file mode 100644 index 0000000..637fb0e --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs @@ -0,0 +1,80 @@ +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.UI; +using System.Linq; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class BgSetting_Color : MenuItem, IVirtualItem + { + public int Index { get; set; } + public BgColorSettings Datacontext { get; private set; } + + public void SetData(object data) + { + Datacontext = (BgColorSettings)data; + Datacontext.OnColorChanged += Setting_OnColorChanged; + + UpdateView(); + } + + private void Setting_OnColorChanged(XMBColor color) + { + UpdateView(); + } + + private void UpdateView() + { + var color = Datacontext.CurrentColor; + Icon.GetMaterial().SetColor("_Color1", color.color1); + Icon.GetMaterial().SetColor("_Color2", color.color2); + SetBaseInfo("ɫ", color.Name); + } + + public void SetDependencyProperty(object data) + { + SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); + } + + public void Release() + { + Datacontext.OnColorChanged -= Setting_OnColorChanged; + } + public override bool OnEnterItem() + { + var options = Datacontext.Presets.Select(preset => new ColorOption(preset)).ToList(); + var currentColor = Datacontext.CurrentColor; + var index = options.FindIndex(op => op.Color.GetHashCode() == currentColor.GetHashCode()); + OptionUI.Instance.Pop(options, Mathf.Clamp(index, 0, options.Count - 1)); + return false; + } + + public class ColorOption : ExecuteMenu + { + public XMBColor Color; + + public ColorOption(XMBColor color) : base(color.Name) + { + Color = color; + } + + public override void OnShow(OptionUI_MenuItem ui) + { + ui.IconUI.gameObject.SetActiveEx(true); + ui.IconUI.SetMaterial(Resources.Load("Materials/XMBBackGroundPreview")); + ui.IconUI.GetMaterial().SetColor("_Color1", Color.color1); + ui.IconUI.GetMaterial().SetColor("_Color2", Color.color2); + } + + public override void OnFocus() + { + App.settings.BgColor.CurrentColor = Color; + } + + public override void OnExcute() + { + + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSettingItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSettingItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs new file mode 100644 index 0000000..ed0569b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs @@ -0,0 +1,13 @@ +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class SettingItemSelector : ItemSelector + { + protected override RectTransform OnGetTemplate(object data) + { + if (data is BgColorSettings) return ItemList[0]; + else return null; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs.meta new file mode 100644 index 0000000..1cb1d85 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e7f64bad63ce024eadbd9ddff940eee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs index ce71d3c..68f1825 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs @@ -12,9 +12,7 @@ namespace AxibugEmuOnline.Client private PulseInvoker m_pulsInvoker_Up; private PulseInvoker m_pulsInvoker_Down; - [SerializeField] float PulseInvoke_Delay = 0.4f; - [SerializeField] float PulseInvoke_Interval = 0.05f; public abstract bool Enable { get; } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs index 93f3eb8..f2ea41b 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs @@ -49,7 +49,7 @@ public class ItemPresent : GridLayoutGroup, IVirtualLayout { for (int i = 0; i < gap; i++) { - ItemProxy item = new ItemProxy(ItemTemplate, this); + ItemProxy item = new ItemProxy(this); children.Add(item); item.Width = cellSize.x; item.Height = cellSize.y; @@ -74,6 +74,11 @@ public class ItemPresent : GridLayoutGroup, IVirtualLayout private List handleChildren = new List(); private bool m_dataDirty; + private ItemSelector m_itemSelector; + protected override void Awake() + { + m_itemSelector = gameObject.GetComponent(); + } public override void CalculateLayoutInputHorizontal() { @@ -540,4 +545,10 @@ public class ItemPresent : GridLayoutGroup, IVirtualLayout return this.GetItemUIIfExist(dataIndex); } + + public RectTransform GetTemplate(object data) + { + if (m_itemSelector == null) return ItemTemplate; + else return m_itemSelector.GetItemTemplate(data); + } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs index fe55287..6f60218 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs @@ -11,7 +11,7 @@ public interface IVirtualLayout public List DataList { get; } public object DependencyProperty { get; } public RectTransform RectTransform { get; } - + public RectTransform GetTemplate(object data); public Vector2 GetItemAnchorePos(int index); public RectTransform GetItemUIIfExist(int index); @@ -36,7 +36,7 @@ public class ItemProxy private IVirtualLayout _parent; - private RectTransform _template; + private RectTransform _template => _parent.GetTemplate(_parent.DataList[Index]); private RectTransform _runtimeInstance; private LayoutGroup _layoutElement; @@ -71,15 +71,11 @@ public class ItemProxy return lfi; } - private Vector2? _forcePivot; - public ItemProxy(RectTransform Template, IVirtualLayout parent, Vector2? forcePivot = null) + public ItemProxy(IVirtualLayout parent) { - _template = Template; _parent = parent; - _forcePivot = forcePivot; } - public void Dispose() { if (_runtimeInstance != null) @@ -140,10 +136,6 @@ public class ItemProxy _runtimeInstance.gameObject.SetActive(true); _runtimeInstance.anchorMax = Vector2.up; _runtimeInstance.anchorMin = Vector2.up; - if (_forcePivot != null) - { - _runtimeInstance.pivot = _forcePivot.Value; - } _runtimeInstance.anchoredPosition = AnchoredPosition; _runtimeInstance.sizeDelta = new Vector2(Width, Height); } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs new file mode 100644 index 0000000..9292bc6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using UnityEngine; + +public abstract class ItemSelector : MonoBehaviour +{ + [SerializeField] + protected List ItemList; + + public RectTransform GetItemTemplate(object data) + { + return OnGetTemplate(data); + } + + protected abstract RectTransform OnGetTemplate(object data); +} + diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs.meta new file mode 100644 index 0000000..71ee5a6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c1183d0b3c0c5a4a8d3c4cf4c412ab9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs index 7f59fb4..1c2d95b 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Generic; using System.Linq; using UnityEngine; +using UnityEngine.UI; +using static UnityEditor.Graphs.Styles; namespace AxibugEmuOnline.Client { @@ -126,7 +128,7 @@ namespace AxibugEmuOnline.Client } ControlScheme m_lastCS; - public void Pop(List menus, int defaultIndex = 0) + public void Pop(List menus, int defaultIndex = 0) where T : OptionMenu { ReleaseRuntimeMenus(); foreach (var menu in menus) CreateRuntimeMenuItem(menu); @@ -258,6 +260,9 @@ namespace AxibugEmuOnline.Client Name = name; Icon = icon; } + + public virtual void OnFocus() { } + public virtual void OnShow(OptionUI_MenuItem ui) { } } public abstract class ExecuteMenu : OptionMenu @@ -267,15 +272,6 @@ namespace AxibugEmuOnline.Client public abstract void OnExcute(); } - public abstract class ValueSetMenu : OptionMenu - { - public ValueSetMenu(string name) : base(name) { } - - public abstract Type ValueType { get; } - public abstract object ValueRaw { get; } - public abstract void OnValueChanged(object newValue); - } - public class ValueSetMenu : ValueSetMenu { public sealed override Type ValueType => typeof(T); @@ -290,4 +286,15 @@ namespace AxibugEmuOnline.Client } protected ValueSetMenu(string name) : base(name) { } } + + public abstract class ValueSetMenu : OptionMenu + { + public ValueSetMenu(string name) : base(name) { } + + public abstract Type ValueType { get; } + public abstract object ValueRaw { get; } + public abstract void OnValueChanged(object newValue); + } + + } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs index b06669c..3069f47 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs @@ -6,9 +6,5 @@ namespace AxibugEmuOnline.Client { MenuData.OnExcute(); } - - public override void OnFocus() - { - } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs index 7115085..7cf884e 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs @@ -12,6 +12,8 @@ namespace AxibugEmuOnline.Client [SerializeField] Text m_MenuNameTxt; [SerializeField] Image m_Icon; + public Image IconUI => m_Icon; + public bool Visible => m_Menu.Visible; protected OptionMenu m_Menu; @@ -24,13 +26,14 @@ namespace AxibugEmuOnline.Client else { m_Icon.gameObject.SetActiveEx(true); + m_Icon.SetMaterial(null); m_Icon.sprite = menuData.Icon; } OnSetData(menuData); } - protected virtual void OnSetData(OptionMenu menuData) { } + protected abstract void OnSetData(OptionMenu menuData); public abstract void OnExecute(); public abstract void OnFocus(); @@ -40,5 +43,15 @@ namespace AxibugEmuOnline.Client where T : OptionMenu { protected T MenuData => m_Menu as T; + + protected override void OnSetData(OptionMenu menuData) + { + MenuData.OnShow(this); + } + + public override void OnFocus() + { + MenuData.OnFocus(); + } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs b/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs new file mode 100644 index 0000000..0034716 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs @@ -0,0 +1,33 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public static class UITool + { + private static Dictionary _caches = new Dictionary(); + + public static Material GetMaterial(this Graphic graphic) + { + if (_caches.TryGetValue(graphic, out var material)) + { + return material; + } + else + { + var cloneMat = Material.Instantiate(graphic.material); + _caches[graphic] = cloneMat; + graphic.material = cloneMat; + return cloneMat; + } + } + + public static void SetMaterial(this Graphic graphic, Material material) + { + graphic.material = material; + _caches.Remove(graphic); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs.meta new file mode 100644 index 0000000..6a5951b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6afcd2bba4414a74db17de9347dbbcef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader new file mode 100644 index 0000000..29e7079 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader @@ -0,0 +1,190 @@ +Shader "AxibugEmuOnline/XMBBackGroundPreview" +{ + Properties + { + _MainTex ("Sprite Texture", 2D) = "white" {} + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + + [Space(10)] + _Color1("Color1",Color) = (0,0.4,1,1) + _Color2("Color2",Color) = (0,0.7,1,1) + + [Header(Wave1)] + _MidHeight1("MidHeight",Float) = 0.4 + _MaxHeight1("MaxHeigh",Float) = 0.5 + _Power1("Power",Float)=50.0 + _Frequency1("Frequency",Float)=2.0 + _Speed1("Speed",Float)=0.4 + + [Header(Wave2)] + _MidHeight2("MidHeight",Float) = 0.42 + _MaxHeight2("MaxHeigh",Float) = 0.54 + _Power2("Power",Float)=50.0 + _Frequency2("Frequency",Float)=2.1 + _Speed2("Speed",Float)=0.3 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + UNITY_VERTEX_OUTPUT_STEREO + }; + + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + sampler2D _MainTex; + + float wave(float x, float frequency, float speed, float midHeight, float maxHeight) + { + return (sin(frequency * (x + speed * (((1. - (pow(cos(0.002 * (_Time.y + 400.)), 2.) + 1.) / 2.) + .1) * 2048.))) * (maxHeight - midHeight)) + midHeight; + } + float percentHigh(float currentY, float waveHeight, float maxHeight, float power) + { + float percentWave = max(waveHeight - currentY, 0.0) / maxHeight; + return pow(1.0 - percentWave, power); + } + float waveColor(float2 uv, float waveHeight, float maxHeight, float frequency, float power) + { + float percentWave = percentHigh(uv.y, waveHeight, maxHeight, power); + return clamp(percentWave + 0.8, 0.0, 1.0); + } + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + OUT.worldPosition = v.vertex; + OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); + + OUT.texcoord =v.texcoord; + + OUT.color = v.color * _Color; + return OUT; + } + + float3 _Color1; + float3 _Color2; + + float _MidHeight1; + float _MaxHeight1; + float _Power1; + float _Frequency1; + float _Speed1; + + float _MidHeight2; + float _MaxHeight2; + float _Power2; + float _Frequency2; + float _Speed2; + + fixed4 frag(v2f IN) : SV_Target + { + float2 uv= IN.texcoord; + // Lerped background + + float amount = (uv.x + uv.y) / 2.0; + float3 bg = lerp(_Color2, _Color1, amount); + + // Overlayed sine waves + float maxHeight1 = _MaxHeight1 + wave(0, 4.0,0.02, 0.0, 0.02); + float power1 = _Power1; //Higher power means thinner line + float frequency1 = _Frequency1 + wave(0.0, 3.0, 0.03, 0.0, 0.02); + float speed1 = _Speed1 + wave(0.0, 2.2, 0.04, 0.0, 0.01); + float waveHeight1 = wave(uv.x, frequency1, speed1, _MidHeight1, maxHeight1); + float waveCol1 = waveColor(uv, waveHeight1, maxHeight1, frequency1, power1); + + float midHeight2 = _MidHeight2; + float maxHeight2 = _MaxHeight2 + wave(0.0, 3.0, 0.04, 0.0, 0.02); + float power2 = _Power2; //Higher power means thinner line + float frequency2 = _Frequency2 + wave(0.0, 4.0, 0.05, 0.0, 0.02); + float speed2 = _Speed2 + wave(0.0, 2.0, 0.02, 0.0, 0.01); + float waveHeight2 = wave(uv.x, frequency2, speed2, midHeight2, maxHeight2); + float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); + + float3 col = bg; + col = lerp(col, waveCol1 * col, step(uv.y, waveHeight1)); + col = lerp(col, waveCol2 * col, step(uv.y, waveHeight2)); + + // Output to screen + fixed4 fragColor = float4(col,1.0); + + #ifdef UNITY_UI_CLIP_RECT + fragColor.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (fragColor.a - 0.001); + #endif + + return fragColor; + } + + + + ENDCG + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader.meta b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader.meta new file mode 100644 index 0000000..87eeb81 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 424d88aff12857f4aab1911fdb6e02e9 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs new file mode 100644 index 0000000..414e2ba --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs @@ -0,0 +1,33 @@ +using AxibugEmuOnline.Client.ClientCore; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using static UnityEditor.Graphs.Styles; + +namespace AxibugEmuOnline.Client +{ + public class XMBBgChanger : MonoBehaviour + { + public Image imgUI; + + private void OnEnable() + { + App.settings.BgColor.OnColorChanged += BgColor_OnColorChanged; + + imgUI.GetMaterial().SetColor("_Color1", App.settings.BgColor.CurrentColor.color1); + imgUI.GetMaterial().SetColor("_Color2", App.settings.BgColor.CurrentColor.color2); + } + + private void OnDisable() + { + App.settings.BgColor.OnColorChanged -= BgColor_OnColorChanged; + } + + private void BgColor_OnColorChanged(XMBColor color) + { + imgUI.GetMaterial().SetColor("_Color1", color.color1); + imgUI.GetMaterial().SetColor("_Color2", color.color2); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs.meta new file mode 100644 index 0000000..f8f33df --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34f3a870b3a425c4daead53193dcd9c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From df32ff6a3a6b191ec91a2aba3eae5ba8e921a571 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 14 Nov 2024 19:25:44 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=83=8C=E6=99=AFshade?= =?UTF-8?q?r=E8=A1=A8=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/UIPrefabs/OptionUI.prefab | 40 ++++++++++++++++++- .../Assets/Scene/AxibugEmuOnline.Client.unity | 12 +----- .../Manager/AppSettings/BgColorSettings.cs | 2 +- .../Assets/Script/UI/OptionUI/OptionUI.cs | 2 +- .../Assets/Script/UI/XMBBackGround.shader | 10 +++-- .../Assets/Script/UI/XMBOptionBgChanger.cs | 32 +++++++++++++++ .../Script/UI/XMBOptionBgChanger.cs.meta | 11 +++++ 7 files changed, 93 insertions(+), 16 deletions(-) create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs create mode 100644 AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab index 6b39fd6..fb6530b 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab @@ -108,6 +108,8 @@ GameObject: - component: {fileID: 1315151990470629735} - component: {fileID: 5089554718053375447} - component: {fileID: 7896211045508186424} + - component: {fileID: 46877084639177849} + - component: {fileID: 8225225246167167684} m_Layer: 5 m_Name: bg m_TagString: Untagged @@ -175,7 +177,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 0.5176471} + m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -192,6 +194,42 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &46877084639177849 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 793983410033291345} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fb48d82dc0e94a2b9246d17d04f8748, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Direction: 0 + m_Color1: {r: 1, g: 1, b: 1, a: 1} + m_Color2: {r: 1, g: 1, b: 1, a: 1} + m_Color3: {r: 1, g: 1, b: 1, a: 1} + m_Color4: {r: 1, g: 1, b: 1, a: 1} + m_Rotation: 0 + m_Offset1: 0 + m_Offset2: 0 + m_GradientStyle: 0 + m_ColorSpace: -1 + m_IgnoreAspectRatio: 1 +--- !u!114 &8225225246167167684 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 793983410033291345} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4a02adf5375469d4f8f18de467ab1deb, type: 3} + m_Name: + m_EditorClassIdentifier: + gradient: {fileID: 46877084639177849} --- !u!1 &1731066637017514641 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity index 14f2e72..fc467af 100644 --- a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity +++ b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity @@ -13998,16 +13998,8 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} - target: {fileID: 7896211045508186424, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} - propertyPath: m_Color.b - value: 0.3773585 - objectReference: {fileID: 0} - - target: {fileID: 7896211045508186424, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} - propertyPath: m_Color.g - value: 0.16444026 - objectReference: {fileID: 0} - - target: {fileID: 7896211045508186424, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} - propertyPath: m_Color.r - value: 0 + propertyPath: m_Color.a + value: 0.69803923 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs index a29d8fd..712f9ff 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs @@ -36,7 +36,7 @@ namespace AxibugEmuOnline.Client { DEFAULT, new XMBColor("白","#8a9fb2","#4e9eb6"), - new XMBColor("黄","#d5a916","#d1a813"), + new XMBColor("黄","#987500","#d1a813"), new XMBColor("绿","#3e962b","#7ac25e"), new XMBColor("粉","#e65a8b","#c7acc6"), new XMBColor("墨绿","#00421a","#1c951f"), diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs index 1c2d95b..494c212 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs @@ -137,7 +137,7 @@ namespace AxibugEmuOnline.Client Canvas.ForceUpdateCanvases(); - m_selectIndex = 0; + m_selectIndex = defaultIndex; OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[defaultIndex]; optionUI_MenuItem.OnFocus(); var itemUIRect = optionUI_MenuItem.transform as RectTransform; diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader index 7a7d948..66a9f36 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader @@ -164,9 +164,13 @@ float waveHeight2 = wave(uv.x, frequency2, speed2, midHeight2, maxHeight2); float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); - float3 col = bg; - col = lerp(col, waveCol1 * col, step(uv.y, waveHeight1)); - col = lerp(col, waveCol2 * col, step(uv.y, waveHeight2)); + float3 col = bg; + + float3 waveCol1_temp=col/waveCol1; + col = lerp(col,waveCol1_temp, step(uv.y, waveHeight1)); + + float3 waveCol2_temp=col/waveCol2; + col = lerp(col,waveCol2_temp, step(uv.y, waveHeight2)); // Output to screen fixed4 fragColor = float4(col,1.0); diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs b/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs new file mode 100644 index 0000000..0273d45 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs @@ -0,0 +1,32 @@ +using AxibugEmuOnline.Client.ClientCore; +using Coffee.UIExtensions; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class XMBOptionBgChanger : MonoBehaviour + { + public UIGradient gradient; + + private void OnEnable() + { + App.settings.BgColor.OnColorChanged += BgColor_OnColorChanged; + + var color = App.settings.BgColor.CurrentColor; + gradient.color1 = color.color1; + gradient.color2 = color.color2; + } + + private void OnDisable() + { + App.settings.BgColor.OnColorChanged -= BgColor_OnColorChanged; + } + + private void BgColor_OnColorChanged(XMBColor color) + { + gradient.color1 = color.color1; + gradient.color2 = color.color2; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs.meta b/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs.meta new file mode 100644 index 0000000..cffe64b --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a02adf5375469d4f8f18de467ab1deb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 2c36f91725c48ea3dda30255c78eccac807fdfbe Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 14 Nov 2024 20:07:24 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=B8=90=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manager/AppSettings/BgColorSettings.cs | 14 ++++++++++- .../Script/UI/BgSettingsUI/BgSetting_Color.cs | 24 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs index 712f9ff..8d0ac3f 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using DG.Tweening; +using System; +using System.Collections.Generic; using UnityEngine; namespace AxibugEmuOnline.Client @@ -60,6 +62,16 @@ namespace AxibugEmuOnline.Client ColorUtility.TryParseHtmlString(colorCodeStr2, out color2); } + public static XMBColor Lerp(XMBColor start, XMBColor endColor, float t) + { + var result = new XMBColor(); + result.Name = endColor.Name; + result.color1 = Color.Lerp(start.color1, endColor.color1, t); + result.color2 = Color.Lerp(start.color2, endColor.color2, t); + + return result; + } + public override int GetHashCode() { int hash = 17; diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs index 637fb0e..b2f1817 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs @@ -1,5 +1,8 @@ using AxibugEmuOnline.Client.ClientCore; using AxibugEmuOnline.Client.UI; +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; using System.Linq; using UnityEngine; @@ -66,9 +69,28 @@ namespace AxibugEmuOnline.Client ui.IconUI.GetMaterial().SetColor("_Color2", Color.color2); } + private static TweenerCore s_colorChangeTween; public override void OnFocus() { - App.settings.BgColor.CurrentColor = Color; + float progress = 0; + XMBColor start = App.settings.BgColor.CurrentColor; + XMBColor endColor = Color; + + if (s_colorChangeTween != null) + { + s_colorChangeTween.Kill(); + s_colorChangeTween = null; + } + s_colorChangeTween = DOTween.To(() => progress, (x) => + { + progress = x; + var lerpColor = XMBColor.Lerp(start, endColor, x); + App.settings.BgColor.CurrentColor = lerpColor; + }, 1, 1f).SetEase(Ease.OutCubic); + s_colorChangeTween.onComplete = () => + { + s_colorChangeTween = null; + }; } public override void OnExcute() From 56f2953a99496b4a16e2f92beefd86654bbf07fa Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 14 Nov 2024 20:10:01 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=A2=84=E8=A7=88shade?= =?UTF-8?q?r=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/UI/XMBBackGroundPreview.shader | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader index 29e7079..4ba64dd 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader @@ -165,8 +165,8 @@ float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); float3 col = bg; - col = lerp(col, waveCol1 * col, step(uv.y, waveHeight1)); - col = lerp(col, waveCol2 * col, step(uv.y, waveHeight2)); + col = lerp(col, col/waveCol1, step(uv.y, waveHeight1)); + col = lerp(col, col/waveCol2, step(uv.y, waveHeight2)); // Output to screen fixed4 fragColor = float4(col,1.0); From d3f1f76e702132c5888dee7ef4d9f73bae7f2cda Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 14 Nov 2024 20:23:51 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E5=8A=A8=E6=95=88=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Resources/Icons/MenuHighLight.png | Bin 0 -> 1633 bytes .../Resources/Icons/MenuHighLight.png.meta | 120 ++++++++++++++++++ .../Resources/UIPrefabs/OptionUI.prefab | 21 ++- .../UIPrefabs/SelectBorder.controller | 2 +- .../Resources/UIPrefabs/SelectBorderLoop.anim | 8 +- 5 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 AxibugEmuOnline.Client/Assets/Resources/Icons/MenuHighLight.png create mode 100644 AxibugEmuOnline.Client/Assets/Resources/Icons/MenuHighLight.png.meta diff --git a/AxibugEmuOnline.Client/Assets/Resources/Icons/MenuHighLight.png b/AxibugEmuOnline.Client/Assets/Resources/Icons/MenuHighLight.png new file mode 100644 index 0000000000000000000000000000000000000000..3e1b53345a9d0e588dc2a23539598a2a2055c96c GIT binary patch literal 1633 zcmV-n2A=teP) zi)!OY5JmN9dFKDWb{t#wlAzw)TvxT^EW_gTInc;4euO{{w@Rhfc)#Co!!X=!)#vn> zEqyNlfHEd)8a|Ky*jN3Gp@?i;PA;l7c)Z$skrn_{R8~`P)HOF8GS$y3jU?rQTJ7;_ zuOn#zfD$DsmsCC8w&T3L-#zjnEl*f3p>=0nNm>AqkO^uMIjO8P^vtyk+>Yk&vASqvOCaRmPVsp)04_7T3#M{(gJ|~gtbVzs%|(1!|9Q%{0!q-#~O~7gzsWHi>%Hj zuB<$~Q4#`lgPt8+L{?sPwaP#rg;=+rZ&69;4R=pgXIUyPZ^~a07C?85*0(w}dfOG3 zRTb6MhD&dIC83vt=VW=(QfW~V0`!CSuOeARC*dMlX}VfL2?{{HOJ zoM_73`&fT0Wx2H8NLT>fG07OiGs2p!_wASa-Beh6vsjU|ygaPO`aB5>pg**nYc<$C zRq4D|T1plh+{%)c_p>r-Y1*o(sT#tk4et%4T-FL7l*^UzPPZ4gVM?_iuOfG2+$8zOe(8cB&HMao~RD(@)8Ma zNN!BAH>>5F{9O?iKvz^@4K@g>WuNz{p4y5k6ILa=Ct)-rku7>y0DZCNgJ|605YspQ zj7PrYZbty0ga!c;fia!F7Cg~?$7XKx1<)Onh^Wfyx23IFVK@(FcUJ zkgx!{V=`eaBCMlZvTv+oanEFNDuhOB=Y!pJTE2JC*=#Q+m6iF)^Cd~#(|1AmUO)kZbk*uah zlip{x5EejR9J#!2u`*2W1@(pr+0&SFKv zYRM}4Mf5^w-?;$*`r?_56g+iBb65{0;Vgg7thv57zTlVbP!0n0$(}Ewy|SYHvcij@ zHDP5$WneK$Y0qk9oB^O~qV`cVlpYBxlGQ^=sI&${S1AK$6I3(}4*-4g%q}pqNh;m7 zK`+gzrD53-R+W|t%4J142mtDjQRLH-Q<$uxi=S_jwq`S=TQU+ Date: Fri, 15 Nov 2024 09:49:15 +0800 Subject: [PATCH 13/14] =?UTF-8?q?XMB=20shader=E7=8E=B0=E5=9C=A8=E6=98=AF?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=AE=8C=E5=A4=87=E7=9A=84ugui=20shader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scene/AxibugEmuOnline.Client.unity | 20 ++++++++-- .../Assets/Script/UI/XMBBackGround.shader | 31 +++++++++++----- .../Script/UI/XMBBackGroundPreview.shader | 37 ++++++++++++++----- 3 files changed, 65 insertions(+), 23 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity index fc467af..33fd3b1 100644 --- a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity +++ b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity @@ -2499,7 +2499,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1639091784002085428, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_RootOrder - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 1639091784002085428, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_AnchorMax.x @@ -13645,7 +13645,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1963501579241001456, guid: 334eee9f85f308347844f8f5e99167c3, type: 3} propertyPath: m_RootOrder - value: 2 + value: 3 objectReference: {fileID: 0} - target: {fileID: 1963501579241001456, guid: 334eee9f85f308347844f8f5e99167c3, type: 3} propertyPath: m_AnchorMax.x @@ -13723,6 +13723,10 @@ PrefabInstance: propertyPath: m_Name value: InGameUI objectReference: {fileID: 0} + - target: {fileID: 1963501579241001457, guid: 334eee9f85f308347844f8f5e99167c3, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 334eee9f85f308347844f8f5e99167c3, type: 3} --- !u!1001 &3531919738450164441 @@ -13736,6 +13740,10 @@ PrefabInstance: propertyPath: m_Name value: Overlay objectReference: {fileID: 0} + - target: {fileID: 3531919739338806916, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} propertyPath: m_Pivot.x value: 0.5 @@ -13746,7 +13754,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} propertyPath: m_RootOrder - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} propertyPath: m_AnchorMax.x @@ -13885,6 +13893,10 @@ PrefabInstance: propertyPath: m_Name value: OptionUI objectReference: {fileID: 0} + - target: {fileID: 4478785627166277609, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4478785627166277610, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} propertyPath: m_Pivot.x value: 0.5 @@ -13895,7 +13907,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4478785627166277610, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} propertyPath: m_RootOrder - value: 1 + value: 2 objectReference: {fileID: 0} - target: {fileID: 4478785627166277610, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} propertyPath: m_AnchorMax.x diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader index 66a9f36..cf9a146 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader @@ -2,7 +2,9 @@ { Properties { - _MainTex ("Sprite Texture", 2D) = "white" {} + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} + _Color ("Tint", Color) = (1,1,1,1) + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 @@ -11,7 +13,6 @@ _ColorMask ("Color Mask", Float) = 15 - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 [Space(10)] @@ -88,6 +89,7 @@ fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float4 worldPosition : TEXCOORD1; + float4 mask : TEXCOORD2; UNITY_VERTEX_OUTPUT_STEREO }; @@ -95,6 +97,9 @@ fixed4 _TextureSampleAdd; float4 _ClipRect; sampler2D _MainTex; + float4 _MainTex_ST; + float _UIMaskSoftnessX; + float _UIMaskSoftnessY; float wave(float x, float frequency, float speed, float midHeight, float maxHeight) { @@ -116,10 +121,17 @@ v2f OUT; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + float4 vPosition = UnityObjectToClipPos(v.vertex); OUT.worldPosition = v.vertex; - OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); + OUT.vertex = vPosition; - OUT.texcoord =v.texcoord; + float2 pixelSize = vPosition.w; + pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + + float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); OUT.color = v.color * _Color; return OUT; @@ -142,8 +154,8 @@ fixed4 frag(v2f IN) : SV_Target { - float2 uv= IN.texcoord; - // Lerped background + float2 uv= IN.texcoord; + // Lerped background float amount = (uv.x + uv.y) / 2.0; float3 bg = lerp(_Color2, _Color1, amount); @@ -164,7 +176,7 @@ float waveHeight2 = wave(uv.x, frequency2, speed2, midHeight2, maxHeight2); float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); - float3 col = bg; + float3 col = bg; float3 waveCol1_temp=col/waveCol1; col = lerp(col,waveCol1_temp, step(uv.y, waveHeight1)); @@ -173,10 +185,11 @@ col = lerp(col,waveCol2_temp, step(uv.y, waveHeight2)); // Output to screen - fixed4 fragColor = float4(col,1.0); + fixed4 fragColor = float4(col,1.0)*IN.color; #ifdef UNITY_UI_CLIP_RECT - fragColor.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); + half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); + fragColor.a *= m.x * m.y; #endif #ifdef UNITY_UI_ALPHACLIP diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader index 4ba64dd..5bd7a18 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader +++ b/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader @@ -2,7 +2,9 @@ { Properties { - _MainTex ("Sprite Texture", 2D) = "white" {} + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} + _Color ("Tint", Color) = (1,1,1,1) + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 @@ -11,7 +13,6 @@ _ColorMask ("Color Mask", Float) = 15 - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 [Space(10)] @@ -88,6 +89,7 @@ fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float4 worldPosition : TEXCOORD1; + float4 mask : TEXCOORD2; UNITY_VERTEX_OUTPUT_STEREO }; @@ -95,6 +97,9 @@ fixed4 _TextureSampleAdd; float4 _ClipRect; sampler2D _MainTex; + float4 _MainTex_ST; + float _UIMaskSoftnessX; + float _UIMaskSoftnessY; float wave(float x, float frequency, float speed, float midHeight, float maxHeight) { @@ -116,10 +121,17 @@ v2f OUT; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + float4 vPosition = UnityObjectToClipPos(v.vertex); OUT.worldPosition = v.vertex; - OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); + OUT.vertex = vPosition; - OUT.texcoord =v.texcoord; + float2 pixelSize = vPosition.w; + pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + + float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); OUT.color = v.color * _Color; return OUT; @@ -142,8 +154,8 @@ fixed4 frag(v2f IN) : SV_Target { - float2 uv= IN.texcoord; - // Lerped background + float2 uv= IN.texcoord; + // Lerped background float amount = (uv.x + uv.y) / 2.0; float3 bg = lerp(_Color2, _Color1, amount); @@ -165,14 +177,19 @@ float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); float3 col = bg; - col = lerp(col, col/waveCol1, step(uv.y, waveHeight1)); - col = lerp(col, col/waveCol2, step(uv.y, waveHeight2)); + + float3 waveCol1_temp=col/waveCol1; + col = lerp(col,waveCol1_temp, step(uv.y, waveHeight1)); + + float3 waveCol2_temp=col/waveCol2; + col = lerp(col,waveCol2_temp, step(uv.y, waveHeight2)); // Output to screen - fixed4 fragColor = float4(col,1.0); + fixed4 fragColor = float4(col,1.0)*IN.color; #ifdef UNITY_UI_CLIP_RECT - fragColor.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); + half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); + fragColor.a *= m.x * m.y; #endif #ifdef UNITY_UI_ALPHACLIP From 3249a0b642eb7d0660d4679cd1c80d601528727b Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Fri, 15 Nov 2024 10:53:19 +0800 Subject: [PATCH 14/14] =?UTF-8?q?UI=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Background_Template.prefab | 8 +- .../BgSetting_Color_ItemTemplate.prefab | 132 +++++++++++++++++- .../RomItemTemplate.prefab | 132 ++++++++++++++++-- .../RoomItemTemplate.prefab | 132 ++++++++++++++++-- .../Assets/Scene/AxibugEmuOnline.Client.unity | 8 +- .../Assets/Script/Manager/RomLib/RomFile.cs | 2 + .../Script/UI/BgSettingsUI/BgSetting_Color.cs | 2 +- .../Assets/Script/UI/GamesUI/RomItem.cs | 9 +- .../Script/UI/GamesUI/RomListMenuItem.cs | 4 +- .../Script/UI/ItemPresent/ItemPresent.cs | 2 +- .../Assets/Script/UI/MainMenuController.cs | 1 + .../Assets/Script/UI/MenuItem.cs | 16 ++- .../Assets/Script/UI/RoomUI/RoomItem.cs | 5 +- .../Assets/Script/UI/UITool.cs | 9 +- 14 files changed, 414 insertions(+), 48 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab index 43c10b3..1a78bec 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Background_Template.prefab @@ -541,10 +541,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1ffb0963e9596ce489953bcef1bf3d86, type: 3} m_Name: m_EditorClassIdentifier: - PulseInvoke_Delay: 0.4 - PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} + SubTitle: {fileID: 0} + spline: {fileID: 0} Descript: {fileID: 3380485461544738227} Root: {fileID: 8754483333502849411} ShadowIcon: {fileID: 2619187604372594158} @@ -731,8 +731,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1d1e3e91ac34bc8468f357ee247ffb6a, type: 3} m_Name: m_EditorClassIdentifier: - PulseInvoke_Delay: 0.4 - PulseInvoke_Interval: 0.05 m_menuItemRoot: {fileID: 0} SubMenuItemTemplate: {fileID: 0} alphaGroup: {fileID: 0} @@ -1008,7 +1006,7 @@ MonoBehaviour: m_ChildAlignment: 0 m_StartCorner: 0 m_StartAxis: 0 - m_CellSize: {x: 500, y: 200} + m_CellSize: {x: 500, y: 100} m_Spacing: {x: 0, y: 20} m_Constraint: 1 m_ConstraintCount: 1 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab index 547e210..76e2bb4 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/BgSetting_Color_ItemTemplate.prefab @@ -30,7 +30,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -369,10 +369,12 @@ MonoBehaviour: m_EditorClassIdentifier: Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} + SubTitle: {fileID: 6534898873012636952} + spline: {fileID: 4812759387377418448} Descript: {fileID: 3380485461544738227} Root: {fileID: 8754483333502849411} ShadowIcon: {fileID: 2619187604372594158} - InfoNode: {fileID: 0} + InfoNode: {fileID: 6788248266412682264} SubMenuItemGroup: {fileID: 0} SelectScale: 1 UnSelectScale: 0.85 @@ -409,6 +411,7 @@ RectTransform: m_Children: - {fileID: 6095356919362338847} - {fileID: 6797116381500671839} + - {fileID: 6673031368290035463} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} m_RootOrder: 2 @@ -433,10 +436,10 @@ MonoBehaviour: m_Padding: m_Left: 20 m_Right: 0 - m_Top: 0 + m_Top: 13 m_Bottom: 0 - m_ChildAlignment: 3 - m_Spacing: 10 + m_ChildAlignment: 0 + m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 @@ -599,7 +602,8 @@ RectTransform: 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_Children: [] + m_Children: + - {fileID: 8986746042327041630} m_Father: {fileID: 8789823129857705082} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -665,6 +669,85 @@ MonoBehaviour: m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} m_EffectDistance: {x: 1.5, y: 1.5} m_UseGraphicAlpha: 1 +--- !u!1 &5468696000904882177 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8986746042327041630} + - component: {fileID: 952406696262539679} + - component: {fileID: 6534898873012636952} + m_Layer: 5 + m_Name: subTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8986746042327041630 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5468696000904882177} + 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_Children: [] + m_Father: {fileID: 6095356919362338847} + m_RootOrder: 0 + 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: 580, y: 33} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &952406696262539679 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5468696000904882177} + m_CullTransparentMesh: 1 +--- !u!114 &6534898873012636952 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5468696000904882177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 25 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 300 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 4324234 --- !u!1 &6688216270065609628 GameObject: m_ObjectHideFlags: 0 @@ -677,7 +760,7 @@ GameObject: - component: {fileID: 5682159953164052307} - component: {fileID: 4812759387377418448} m_Layer: 5 - m_Name: Image + m_Name: spline m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -778,3 +861,38 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &9036340599819825964 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6673031368290035463} + m_Layer: 5 + m_Name: space + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6673031368290035463 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9036340599819825964} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 2 + 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: 10} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RomItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RomItemTemplate.prefab index e73dfa6..f549c79 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RomItemTemplate.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RomItemTemplate.prefab @@ -30,7 +30,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -79,6 +79,85 @@ MonoBehaviour: m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: DESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTION +--- !u!1 &691794202561892957 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1188556931387892201} + - component: {fileID: 2202468443856696916} + - component: {fileID: 999260425140749620} + m_Layer: 5 + m_Name: subTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1188556931387892201 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 691794202561892957} + 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_Children: [] + m_Father: {fileID: 6095356919362338847} + m_RootOrder: 0 + 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: 580, y: 33} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &2202468443856696916 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 691794202561892957} + m_CullTransparentMesh: 1 +--- !u!114 &999260425140749620 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 691794202561892957} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 25 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 300 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 4324234 --- !u!1 &734025543935719296 GameObject: m_ObjectHideFlags: 0 @@ -684,14 +763,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f236de3ffaafd4149a3b7395e05b8d07, type: 3} m_Name: m_EditorClassIdentifier: - PulseInvoke_Delay: 0.4 - PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} + SubTitle: {fileID: 999260425140749620} + spline: {fileID: 72627194734755216} Descript: {fileID: 3380485461544738227} Root: {fileID: 8754483333502849411} ShadowIcon: {fileID: 2619187604372594158} - InfoNode: {fileID: 0} + InfoNode: {fileID: 6788248266412682264} SubMenuItemGroup: {fileID: 0} SelectScale: 1 UnSelectScale: 0.8 @@ -719,6 +798,41 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 +--- !u!1 &3387258383767365065 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7783773379985343815} + m_Layer: 5 + m_Name: space + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7783773379985343815 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3387258383767365065} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 2 + 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: 10} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &3993825260653792697 GameObject: m_ObjectHideFlags: 0 @@ -752,6 +866,7 @@ RectTransform: m_Children: - {fileID: 6095356919362338847} - {fileID: 3242981749023616473} + - {fileID: 7783773379985343815} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} m_RootOrder: 2 @@ -776,10 +891,10 @@ MonoBehaviour: m_Padding: m_Left: 20 m_Right: 0 - m_Top: 0 + m_Top: 40 m_Bottom: 0 - m_ChildAlignment: 3 - m_Spacing: 20 + m_ChildAlignment: 0 + m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 @@ -943,7 +1058,8 @@ RectTransform: 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_Children: [] + m_Children: + - {fileID: 1188556931387892201} m_Father: {fileID: 8789823129857705082} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab index 6334c42..5241953 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab @@ -30,7 +30,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 8789823129857705082} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -79,6 +79,85 @@ MonoBehaviour: m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: DESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTIONDESCRIBTION +--- !u!1 &553998820245994894 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6315089719013752772} + - component: {fileID: 335732242433612964} + - component: {fileID: 5992617271927144214} + m_Layer: 5 + m_Name: subTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6315089719013752772 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553998820245994894} + 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_Children: [] + m_Father: {fileID: 6095356919362338847} + m_RootOrder: 0 + 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: 580, y: 33} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &335732242433612964 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553998820245994894} + m_CullTransparentMesh: 1 +--- !u!114 &5992617271927144214 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553998820245994894} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 25 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 300 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 4324234 --- !u!1 &734025543935719296 GameObject: m_ObjectHideFlags: 0 @@ -609,14 +688,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 321002db0a5429f4da7529d85c93799c, type: 3} m_Name: m_EditorClassIdentifier: - PulseInvoke_Delay: 0.4 - PulseInvoke_Interval: 0.05 Icon: {fileID: 6771349210554360888} Txt: {fileID: 991446423622995247} + SubTitle: {fileID: 5992617271927144214} + spline: {fileID: 1135952883384385484} Descript: {fileID: 3380485461544738227} Root: {fileID: 8754483333502849411} ShadowIcon: {fileID: 2619187604372594158} - InfoNode: {fileID: 0} + InfoNode: {fileID: 6788248266412682264} SubMenuItemGroup: {fileID: 0} SelectScale: 1 UnSelectScale: 0.85 @@ -677,6 +756,7 @@ RectTransform: m_Children: - {fileID: 6095356919362338847} - {fileID: 2553088066574421578} + - {fileID: 7153585803608375682} - {fileID: 8126322204359135913} m_Father: {fileID: 8754483333502849411} m_RootOrder: 2 @@ -701,10 +781,10 @@ MonoBehaviour: m_Padding: m_Left: 20 m_Right: 0 - m_Top: 0 + m_Top: 40 m_Bottom: 0 - m_ChildAlignment: 3 - m_Spacing: 20 + m_ChildAlignment: 0 + m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 @@ -868,7 +948,8 @@ RectTransform: 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_Children: [] + m_Children: + - {fileID: 6315089719013752772} m_Father: {fileID: 8789823129857705082} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1196,3 +1277,38 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &8947967495049136558 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7153585803608375682} + m_Layer: 5 + m_Name: space + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7153585803608375682 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8947967495049136558} + 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_Children: [] + m_Father: {fileID: 8789823129857705082} + m_RootOrder: 2 + 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: 10} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity index 33fd3b1..3cd801f 100644 --- a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity +++ b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity @@ -2499,7 +2499,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1639091784002085428, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_RootOrder - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 1639091784002085428, guid: 450328d5a907c8249a60bc3980ba66f6, type: 3} propertyPath: m_AnchorMax.x @@ -13645,7 +13645,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1963501579241001456, guid: 334eee9f85f308347844f8f5e99167c3, type: 3} propertyPath: m_RootOrder - value: 3 + value: 2 objectReference: {fileID: 0} - target: {fileID: 1963501579241001456, guid: 334eee9f85f308347844f8f5e99167c3, type: 3} propertyPath: m_AnchorMax.x @@ -13754,7 +13754,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} propertyPath: m_RootOrder - value: 4 + value: 3 objectReference: {fileID: 0} - target: {fileID: 3531919739338806919, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} propertyPath: m_AnchorMax.x @@ -13907,7 +13907,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4478785627166277610, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} propertyPath: m_RootOrder - value: 2 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4478785627166277610, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3} propertyPath: m_AnchorMax.x diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs index 0508534..9d91321 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs @@ -37,6 +37,8 @@ namespace AxibugEmuOnline.Client public string Alias => IsUserRom ? Path.GetFileNameWithoutExtension(FileName) : webData.romName; /// 描述 public string Descript => IsUserRom ? string.Empty : webData.desc; + /// 游戏类型 + public string GameTypeDes => IsUserRom ? string.Empty : webData.gType; /// 小图URL public string ImageURL => IsUserRom ? string.Empty : webData.imgUrl; diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs index b2f1817..2943e65 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BgSetting_Color.cs @@ -31,7 +31,7 @@ namespace AxibugEmuOnline.Client var color = Datacontext.CurrentColor; Icon.GetMaterial().SetColor("_Color1", color.color1); Icon.GetMaterial().SetColor("_Color2", color.color2); - SetBaseInfo("ɫ", color.Name); + SetBaseInfo("ɫ", "ɫ", color.Name); } public void SetDependencyProperty(object data) diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs index dd81d0b..abeefb8 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs @@ -59,11 +59,11 @@ namespace AxibugEmuOnline.Client { if (!m_romfile.InfoReady) { - SetBaseInfo(string.Empty, string.Empty); + SetBaseInfo("ȡ", "---", "---"); } else { - SetBaseInfo(m_romfile.Alias, m_romfile.Descript); + SetBaseInfo(m_romfile.Alias, m_romfile.Descript, m_romfile.GameTypeDes); App.CacheMgr.GetSpriteCache(m_romfile.ImageURL, (img, url) => { if (url != m_romfile.ImageURL) return; @@ -90,7 +90,8 @@ namespace AxibugEmuOnline.Client } } - private void Update() + + protected override void Update() { DownloadingFlag.SetActiveEx(false); FileReadyFlag.SetActiveEx(false); @@ -107,6 +108,8 @@ namespace AxibugEmuOnline.Client { FileReadyFlag.SetActiveEx(true); } + + base.Update(); } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs index aacebc1..7786123 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs @@ -76,7 +76,7 @@ namespace AxibugEmuOnline.Client public override void OnExcute() { - OverlayManager.Input((OnSearchCommit, "Rom", null)); + OverlayManager.Input((OnSearchCommit, "Rom", m_romListUI.SearchKey)); } private void OnSearchCommit(string text) @@ -92,7 +92,7 @@ namespace AxibugEmuOnline.Client public override bool Visible => !string.IsNullOrWhiteSpace(m_ui.SearchKey); - public OptMenu_ShowAll(RomListMenuItem romListUI,Sprite icon = null) : base("ʾȫ", icon) + public OptMenu_ShowAll(RomListMenuItem romListUI, Sprite icon = null) : base("ʾȫ", icon) { m_ui = romListUI; } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs index f2ea41b..b3de33a 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs @@ -507,7 +507,7 @@ public class ItemPresent : GridLayoutGroup, IVirtualLayout proxy.UpdateDP(); } - m_dataDirty = true; + //m_dataDirty = true; } public Dictionary CacheItemScripts => _cacheItemScripts; diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs b/AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs index 35b94f9..e97d2cd 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs @@ -171,6 +171,7 @@ namespace AxibugEmuOnline.Client.UI { public Sprite Icon; public string Name; + public string SubTitle; public string Description; public MenuItem OverrideTemplate; public List SubMenus; diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs index 815613c..093db7a 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs @@ -13,6 +13,10 @@ namespace AxibugEmuOnline.Client.UI [SerializeField] protected Text Txt; [SerializeField] + protected Text SubTitle; + [SerializeField] + protected Image spline; + [SerializeField] protected Text Descript; [SerializeField] protected Transform Root; @@ -42,7 +46,7 @@ namespace AxibugEmuOnline.Client.UI { Reset(); - SetBaseInfo(data.Name, data.Description); + SetBaseInfo(data.Name, data.Description, data.SubTitle); SetIcon(data.Icon); if (SubMenuItemGroup != null) SubMenuItemGroup.Init(data.SubMenus); } @@ -59,15 +63,17 @@ namespace AxibugEmuOnline.Client.UI if (ShadowIcon != null) ShadowIcon.gameObject.SetActive(false); if (InfoNode != null) InfoNode.alpha = 0; + if (spline != null) spline.SetAlpha(0); if (ShadowIcon != null) ShadowIcon.gameObject.SetActiveEx(false); if (SubMenuItemGroup != null) SubMenuItemGroup.SetSelect(false); } - protected void SetBaseInfo(string name, string descript) + protected void SetBaseInfo(string name, string descript, string subTitle) { this.name = name; if (Txt != null) Txt.text = name; + if (SubTitle != null) SubTitle.text = subTitle; if (Descript != null) Descript.text = descript; } @@ -91,11 +97,11 @@ namespace AxibugEmuOnline.Client.UI if (progressTween != null) { progressTween.Kill(); progressTween = null; } - progressTween = DOTween.To(() => m_progress, (x) => m_progress = x, m_select ? 1 : 0, 5) - .SetSpeedBased().OnUpdate(() => + progressTween = DOTween.To(() => m_progress, (x) => m_progress = x, m_select ? 1 : 0, 0.3f) + .OnUpdate(() => { if (InfoNode != null) InfoNode.alpha = m_progress; - + if (spline != null) spline.SetAlpha(m_progress); Root.localScale = Vector3.one * Mathf.Lerp(UnSelectScale, SelectScale, m_progress); }); } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs index 6db698c..94e1c14 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs @@ -65,7 +65,7 @@ namespace AxibugEmuOnline.Client { var hostNick = roomInfo.GetHostNickName(); roomInfo.GetRoomPlayers(out var cur, out var max); - SetBaseInfo(string.Empty, $"{hostNick}ķ - {cur}/{max}"); + SetBaseInfo("--", $"{hostNick}ķ", $"{cur}/{max}"); SetIcon(null); roomInfo.FetchRomFileInRoomInfo(EnumPlatform.NES, (room, romFile) => @@ -80,9 +80,10 @@ namespace AxibugEmuOnline.Client }); } - private void Update() + protected override void Update() { UpdateRomInfoView(); + base.Update(); } private void UpdateRomInfoView() diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs b/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs index 0034716..9ea68bf 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs @@ -8,7 +8,6 @@ namespace AxibugEmuOnline.Client public static class UITool { private static Dictionary _caches = new Dictionary(); - public static Material GetMaterial(this Graphic graphic) { if (_caches.TryGetValue(graphic, out var material)) @@ -23,11 +22,17 @@ namespace AxibugEmuOnline.Client return cloneMat; } } - public static void SetMaterial(this Graphic graphic, Material material) { graphic.material = material; _caches.Remove(graphic); } + + public static void SetAlpha(this Graphic graphic, float alpha) + { + var temp = graphic.color; + temp.a = alpha; + graphic.color = temp; + } } }