add:添加购物车逻辑内容,完善整体流程逻辑

FUJIFILM
zc 2025-07-11 22:35:50 +08:00
parent 49eaafc72e
commit 0cfb9f8435
31 changed files with 2843 additions and 2505 deletions

View File

@ -13,7 +13,7 @@ RenderTexture:
m_IsAlphaChannelOptional: 0
serializedVersion: 6
m_Width: 1080
m_Height: 1080
m_Height: 1920
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 0

View File

@ -24,16 +24,20 @@ Material:
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_ValidKeywords:
- _ALPHAPREMULTIPLY_ON
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Opaque
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- DepthOnly
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
@ -96,6 +100,7 @@ Material:
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
@ -107,8 +112,8 @@ Material:
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _DstBlend: 10
- _DstBlendAlpha: 10
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
@ -123,12 +128,12 @@ Material:
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _Surface: 1
- _WorkflowMode: 1
- _ZWrite: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 0.89433956, g: 0.89433956, b: 0.89433956, a: 1}
- _Color: {r: 0.89433956, g: 0.89433956, b: 0.89433956, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 0.6039216}
- _Color: {r: 1, g: 1, b: 1, a: 0.6039216}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []

View File

@ -1 +1 @@
{"NoteBookInformationList":[{"ID":1001,"Desc":"大的笔记本——Large","BookChinName":"大的笔记本——Large","BookEnglishName":"A Large notebook - large","BookPrice":200,"Design":20,"Discount":0},{"ID":1002,"Desc":"小的笔记本——Pocket","BookChinName":"小的笔记本——Pocket","BookEnglishName":"A small notebook - Pocket","BookPrice":150,"Design":15,"Discount":0}]}
{"NoteBookInformationList":[{"ID":1001,"Desc":"大的笔记本——Large","BookChinName":"大的笔记本——Large","BookEnglishName":"A Large notebook - large","BookPrice":200,"DesignPrice":20,"DiscountPrice":0},{"ID":1002,"Desc":"小的笔记本——Pocket","BookChinName":"小的笔记本——Pocket","BookEnglishName":"A small notebook - Pocket","BookPrice":150,"DesignPrice":15,"DiscountPrice":0}]}

View File

@ -294,7 +294,7 @@ MonoBehaviour:
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: rrrr
m_Text:
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
@ -350,7 +350,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &7555311287681103360
Transform:
m_ObjectHideFlags: 0
@ -507,7 +507,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4217243741501710637}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
@ -677,7 +677,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "rrrr\u200B"
m_text: "\u200B"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 41512a7f2b107664d9d14634f444209a, type: 2}
m_sharedMaterial: {fileID: -3454106745002405512, guid: 41512a7f2b107664d9d14634f444209a,
@ -1279,7 +1279,7 @@ MonoBehaviour:
- {x: -1.05, y: 0.17, z: 0.0128}
- {x: 0, y: 0.17, z: 0.0128}
model: {fileID: 6293017588140709312}
doTweenTime: 1
doTweenTime: 0.3
designCoverModelItem: {fileID: 9095075417828674992}
renderCamera: {fileID: 2276259505965401185}
--- !u!4 &6293017588140709312 stripped

View File

@ -876,7 +876,7 @@ MonoBehaviour:
localRotation: {x: 0, y: 0, z: 0, w: 0}
localScale: {x: 1, y: 1, z: 1}
maxSize: 160
doTweenTime: 1
doTweenTime: 0.3
--- !u!1 &1638954886860256627
GameObject:
m_ObjectHideFlags: 0
@ -2050,8 +2050,6 @@ MonoBehaviour:
go: {fileID: 2272975925328222970}
- name: Keyboard
go: {fileID: 4905901911969122679}
- name: DesignCover
go: {fileID: 1610381846461383386}
--- !u!114 &3616404699162539039
MonoBehaviour:
m_ObjectHideFlags: 0
@ -2068,7 +2066,6 @@ MonoBehaviour:
btnPositionMiddle: {fileID: 0}
btnPositionDown: {fileID: 0}
keyboard: {fileID: 0}
designCoverItem: {fileID: 0}
pos:
- {x: 0, y: 313}
- {x: 0, y: -313}
@ -3144,7 +3141,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: 1920, y: 1920}
m_SizeDelta: {x: 1080, y: 1920}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5862794807230552899
CanvasRenderer:
@ -3820,6 +3817,8 @@ MonoBehaviour:
go: {fileID: 1586330168827108103}
- name: Product5Confirm
go: {fileID: 6591374037433053715}
- name: DesignCover
go: {fileID: 1610381846461383386}
--- !u!225 &1515270199715649406
CanvasGroup:
m_ObjectHideFlags: 0
@ -3855,6 +3854,7 @@ MonoBehaviour:
Product3Text: {fileID: 0}
Product4Line: {fileID: 0}
Product5Confirm: {fileID: 0}
designCoverItem: {fileID: 0}
--- !u!1 &5751609039236445517
GameObject:
m_ObjectHideFlags: 0
@ -5599,8 +5599,6 @@ MonoBehaviour:
go: {fileID: 3277764239860341022}
- name: imgDesignParent
go: {fileID: 7966804754020048263}
- name: DesignCover
go: {fileID: 1610381846461383386}
--- !u!114 &6267590332156799610
MonoBehaviour:
m_ObjectHideFlags: 0
@ -5619,7 +5617,6 @@ MonoBehaviour:
NotebookColorBar: {fileID: 0}
CarouselImage: {fileID: 0}
imgDesignParent: {fileID: 0}
designCoverItem: {fileID: 0}
maxSize: 160
--- !u!1 &9210732582607145042
GameObject:

File diff suppressed because it is too large Load Diff

View File

@ -147,8 +147,8 @@ Light:
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1.4
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
@ -185,9 +185,9 @@ Light:
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 55
m_Bits: 119
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_Lightmapping: 1
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
@ -230,7 +230,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_UsePipelineSettings: 0
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
@ -284,6 +284,71 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3302f01f972d4cdea095c62b6dd58860, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1297905875
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1297905877}
- component: {fileID: 1297905876}
m_Layer: 0
m_Name: Reflection Probe
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!215 &1297905876
ReflectionProbe:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1297905875}
m_Enabled: 1
serializedVersion: 2
m_Type: 0
m_Mode: 1
m_RefreshMode: 0
m_TimeSlicingMode: 0
m_Resolution: 128
m_UpdateFrequency: 0
m_BoxSize: {x: 10, y: 10, z: 10}
m_BoxOffset: {x: 0, y: 0, z: 0}
m_NearClip: 0.3
m_FarClip: 1000
m_ShadowDistance: 100
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_IntensityMultiplier: 1
m_BlendDistance: 1
m_HDR: 1
m_BoxProjection: 0
m_RenderDynamicObjects: 0
m_UseOcclusionCulling: 1
m_Importance: 1
m_CustomBakedTexture: {fileID: 0}
--- !u!4 &1297905877
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1297905875}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.71930337, y: 0.11644912, z: 0.024449587}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1698659432
GameObject:
m_ObjectHideFlags: 0
@ -336,3 +401,4 @@ SceneRoots:
- {fileID: 46943682}
- {fileID: 1698659434}
- {fileID: 186102826}
- {fileID: 1297905877}

View File

@ -108,15 +108,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -321,15 +323,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -493,7 +497,7 @@ RectTransform:
m_Father: {fileID: 5672432403627244962}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 50, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
@ -843,15 +847,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -977,15 +983,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -1111,15 +1119,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -1333,6 +1343,104 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6289535102646543462
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2842693604647789047}
- component: {fileID: 4485674144381741220}
- component: {fileID: 9223102996385336478}
- component: {fileID: 8935892937376086920}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2842693604647789047
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6289535102646543462}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5977931794438213415}
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: 200, y: 200}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4485674144381741220
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6289535102646543462}
m_CullTransparentMesh: 1
--- !u!114 &9223102996385336478
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6289535102646543462}
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: 6700dc48c02f9ea4d8ba6866b7bfdc08, 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!95 &8935892937376086920
Animator:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6289535102646543462}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: df27ce70297995b499e0bb23667cc977, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_AnimatePhysics: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!1 &6307195861053998928
GameObject:
m_ObjectHideFlags: 0
@ -1441,15 +1549,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -1611,15 +1721,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -1653,7 +1765,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1686210318258698559
RectTransform:
m_ObjectHideFlags: 0
@ -2031,15 +2143,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -2165,15 +2279,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -2329,7 +2445,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &8786280722722952149
RectTransform:
m_ObjectHideFlags: 0
@ -2379,8 +2495,8 @@ MonoBehaviour:
m_Calls: []
m_text: 0%
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: b62d42a4efb0a374b8d61e0f108b3d4d, type: 2}
m_sharedMaterial: {fileID: -1397218912698565987, guid: b62d42a4efb0a374b8d61e0f108b3d4d,
m_fontAsset: {fileID: 11400000, guid: 41512a7f2b107664d9d14634f444209a, type: 2}
m_sharedMaterial: {fileID: -3454106745002405512, guid: 41512a7f2b107664d9d14634f444209a,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
@ -2421,15 +2537,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -2480,7 +2598,7 @@ RectTransform:
m_Father: {fileID: 6333683909374370632}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {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}
@ -2630,15 +2748,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -2694,6 +2814,7 @@ RectTransform:
- {fileID: 123959232355030105}
- {fileID: 1686210318258698559}
- {fileID: 8786280722722952149}
- {fileID: 2842693604647789047}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}

View File

@ -17,6 +17,7 @@ namespace HK.Keyboard
private List<KeyBind> keyBinds;
private List<KeyBind> keyBinds_Switch;
public Action OKAction;
public bool isHideOnAwake = false;
private bool isChin
{
@ -43,6 +44,10 @@ namespace HK.Keyboard
inputField.onSelect.AddListener((a) => { gameObject.SetActive(true); });
ShowOnlyOne(AlphaBoardUnshifted);
if (isHideOnAwake)
{
gameObject.SetActive(false);
}
}
void ShowOnlyOne(GameObject go)

View File

@ -0,0 +1,5 @@
using UnityEngine;
public class MonoBehaviourBase : MonoBehaviour
{
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3b06a390a81e447abff851f11ddd996f
timeCreated: 1752229499

View File

@ -11,14 +11,14 @@ Desc_1001 = 1001,
BookChinName_1001 = 1001,
BookEnglishName_1001 = 1001,
BookPrice_1001 = 1001,
Design_1001 = 1001,
Discount_1001 = 1001,
DesignPrice_1001 = 1001,
DiscountPrice_1001 = 1001,
Desc_1002 = 1002,
BookChinName_1002 = 1002,
BookEnglishName_1002 = 1002,
BookPrice_1002 = 1002,
Design_1002 = 1002,
Discount_1002 = 1002,
DesignPrice_1002 = 1002,
DiscountPrice_1002 = 1002,
}
@ -48,11 +48,11 @@ public int BookPrice;
/// <summary>
/// 设计价格
/// </summary>
public int Design;
public int DesignPrice;
/// <summary>
/// 优惠
/// </summary>
public int Discount;
public int DiscountPrice;
}

View File

@ -48,25 +48,72 @@ namespace ZXL.Helper
/// </summary>
/// <param name="camera"></param>
/// <returns></returns>
public static Texture2D SaveCameraToTexture(Camera camera)
public static Texture2D SaveCameraToTexture(Camera camera, bool generateMipMaps = false,
TextureFormat textureFormat = TextureFormat.RGBA32)
{
Texture2D capturedImage;
if (camera == null)
{
Debug.LogError("Camera is null!");
return null;
}
var renderTexture = new RenderTexture(camera.pixelWidth, camera.pixelHeight, 24);
camera.targetTexture = renderTexture;
RenderTexture originalTargetTexture = camera.targetTexture;
RenderTexture tempRenderTexture = null;
Texture2D capturedImage = null;
// 创建一个 Texture2D 用来存储相机捕捉的画面
capturedImage = new Texture2D(renderTexture.width, renderTexture.height, TextureFormat.RGB24, false);
try
{
// 创建临时RenderTexture
tempRenderTexture = RenderTexture.GetTemporary(
camera.pixelWidth, camera.pixelHeight, 24, RenderTextureFormat.Default);
// 从 RenderTexture 中读取像素数据到 Texture2D
RenderTexture.active = renderTexture;
capturedImage.ReadPixels(new Rect(0, 0, renderTexture.width, renderTexture.height), 0, 0);
// 设置相机渲染到临时RenderTexture
camera.targetTexture = tempRenderTexture;
// 强制相机渲染一帧
camera.Render();
// 创建Texture2D
capturedImage = new Texture2D(
tempRenderTexture.width,
tempRenderTexture.height,
textureFormat,
generateMipMaps);
// 保存当前激活的RenderTexture
RenderTexture previousActive = RenderTexture.active;
// 设置临时RenderTexture为当前激活的以便读取像素
RenderTexture.active = tempRenderTexture;
// 读取像素并应用
capturedImage.ReadPixels(new Rect(0, 0, tempRenderTexture.width, tempRenderTexture.height), 0, 0);
capturedImage.Apply();
// 重置 RenderTexture 的激活状态
RenderTexture.active = null;
// 恢复之前的RenderTexture
RenderTexture.active = previousActive;
}
catch (System.Exception e)
{
Debug.LogError($"Error capturing camera: {e.Message}");
if (capturedImage != null)
{
UnityEngine.Object.DestroyImmediate(capturedImage);
capturedImage = null;
}
}
finally
{
// 恢复相机的原始设置
camera.targetTexture = originalTargetTexture;
// 此时 capturedImage 就包含了当前帧的画面,你可以进行保存或者其他操作
// 释放临时RenderTexture
if (tempRenderTexture != null)
{
RenderTexture.ReleaseTemporary(tempRenderTexture);
tempRenderTexture = null;
}
}
return capturedImage;
}

View File

@ -21,6 +21,14 @@ namespace Runtime
EventManager.Instance.Subscribe(Product2DesignCoverClearEventArgs.EventId, Product2DesignCoverClearEvent);
}
private void OnDestroy()
{
EventManager.Instance.Unsubscribe(Product3SetTextTargetEventArgs.EventId, Product3SetTextTargetEvent);
EventManager.Instance.Unsubscribe(Product3SetTextPositionEventArgs.EventId, Product3SetTextPositionEvent);
EventManager.Instance.Unsubscribe(Product2AddDesignCoverEventArgs.EventId, Product2AddDesignCoverEvent);
EventManager.Instance.Unsubscribe(Product2DesignCoverClearEventArgs.EventId, Product2DesignCoverClearEvent);
}
private void Product3SetTextTargetEvent(object sender, GameEventArgs e)
{
var args = e as Product3SetTextTargetEventArgs;

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using DG.Tweening;
using UnityEngine;
using ZGame;
@ -28,10 +29,13 @@ namespace Runtime
model.DOLocalMove(positions[index], doTweenTime);
}
[ContextMenu("GenPreviewImage")]
public byte[] GenPreviewImage()
{
var texture2D = TextureHelper.SaveCameraToTexture(renderCamera);
return texture2D.EncodeToPNG();
var bytes = texture2D.EncodeToPNG();
// File.WriteAllBytes($"{Application.dataPath}/tupian.png", bytes);
return bytes;
}
}
}

View File

@ -8,6 +8,8 @@ namespace Runtime
public string userName = string.Empty;
public string userModie = string.Empty;
public string userEmail = string.Empty;
public string orderID = string.Empty;
public bool isAgreeSubscribe = false;
public List<ShoppingCartData> datas = new List<ShoppingCartData>();
public string totalQuantity = "0";
public string itemsSubTotal = "0";
@ -34,22 +36,24 @@ namespace Runtime
public void UpdateDatas()
{
totalQuantity = datas.Count.ToString();
totalQuantity = string.Empty;
itemsSubTotal = string.Empty;
discount = string.Empty;
totalAmount = string.Empty;
int i = 0, d = 0, t = 0;
int i = 0, d = 0, t = 0, q = 0;
foreach (var shoppingCartData in datas)
{
q += shoppingCartData.count;
i += shoppingCartData.bookAmount * shoppingCartData.count;
d += shoppingCartData.bookDiscount * shoppingCartData.count;
t += shoppingCartData.bookAmount * shoppingCartData.count;
}
itemsSubTotal = i.ToString();
discount = d.ToString();
totalAmount = t.ToString();
totalQuantity = q.ToString();
itemsSubTotal = i.ToString("F");
discount = d.ToString("F");
totalAmount = t.ToString("F");
}
}
@ -59,18 +63,22 @@ namespace Runtime
/// name
/// </summary>
public string bookName;
/// <summary>
/// 价格
/// </summary>
public int bookAmount;
/// <summary>
/// 优惠
/// </summary>
public int bookDiscount;
/// <summary>
/// 数量
/// </summary>
public int count;
public byte[] previewImage;
public byte[] tifImage;
}
@ -90,6 +98,11 @@ namespace Runtime
shoppingCart.RemoveData(data);
}
public void RefreshCart()
{
shoppingCart.UpdateDatas();
}
public void ResetCart()
{
shoppingCart.Reset();

View File

@ -13,4 +13,18 @@ namespace Runtime
this.isShow = isShow;
}
}
public class Product_DesignCover_SetShowEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(Product_DesignCover_SetShowEventArgs).GetHashCode();
public override int Id => EventId;
public bool isShow_Sticker;
public bool isShow_InputText;
public Product_DesignCover_SetShowEventArgs(bool isShowSticker, bool isShowInputText)
{
isShow_Sticker = isShowSticker;
isShow_InputText = isShowInputText;
}
}
}

View File

@ -57,14 +57,24 @@ namespace HK
private void OnClickbtnReduce()
{
if (shoppingCartData.count<=1)
{
return;
}
shoppingCartData.count--;
ShoppingCartManager.Instance.RefreshCart();
txtCount.text = shoppingCartData.count.ToString();
OnUpdateCallback?.Invoke();
}
private void OnClickbtnAdd()
{
if (shoppingCartData.count >= 10)
{
return;
}
shoppingCartData.count++;
ShoppingCartManager.Instance.RefreshCart();
txtCount.text = shoppingCartData.count.ToString();
OnUpdateCallback?.Invoke();
}
@ -76,7 +86,7 @@ namespace HK
shoppingCartData = data;
rawPic.texture = TextureHelper.ConvertByteArrayToTexture2D(data.previewImage);
txtCount.text = data.count.ToString();
txtPrice.text = data.bookAmount.ToString();
txtPrice.text = data.bookAmount.ToString("F");
txtProductName.text = data.bookName;
}

View File

@ -35,6 +35,8 @@ namespace HK
#endregion
EventManager.Instance.Subscribe(Product_DesignCover_SetShowEventArgs.EventId,
Product_DesignCover_SetShowEvent);
EventManager.Instance.Subscribe(ProductIsShowDesignCoverEventArgs.EventId, ProductIsShowDesignCoverEvent);
EventManager.Instance.Subscribe(Product3SetTextPositionEventArgs.EventId, Product3SetTextPositionEvent);
EventManager.Instance.Subscribe(Product2GenStickerEventArgs.EventId, Product2GenStickerEvent);
@ -49,18 +51,35 @@ namespace HK
IsOpenInputFiledTouch(false);
}
private void Product_DesignCover_SetShowEvent(object sender, GameEventArgs e)
{
var args = e as Product_DesignCover_SetShowEventArgs;
IsOpenStickerTouch(args.isShow_Sticker);
IsOpenInputFiledTouch(args.isShow_InputText);
if (args.isShow_InputText && string.IsNullOrEmpty(inpContent.text))
{
inpContent.placeholder.GetComponent<TMP_Text>().text = "Add Text...";
}
else if (!args.isShow_InputText && string.IsNullOrEmpty(inpContent.text))
{
inpContent.placeholder.GetComponent<TMP_Text>().text = "";
}
}
private void ProductIsShowDesignCoverEvent(object sender, GameEventArgs e)
{
var args = e as ProductIsShowDesignCoverEventArgs;
gameObject.SetActive(args.isShow);
}
public void SetTextTarget()
public override void OnShow()
{
base.OnShow();
EventManager.Instance.FireNow(this, new Product3SetTextTargetEventArgs(inpContent));
}
public void IsOpenStickerTouch(bool isOpen)
private void IsOpenStickerTouch(bool isOpen)
{
foreach (var o in designItems)
{
@ -151,24 +170,6 @@ namespace HK
designItems.Add(obj);
}
public void CheckShow()
{
IsOpenInputFiledTouch(true);
if (string.IsNullOrEmpty(inpContent.text))
{
inpContent.placeholder.GetComponent<TMP_Text>().text = "Add Text...";
}
}
public void CheckHide()
{
IsOpenInputFiledTouch(false);
if (string.IsNullOrEmpty(inpContent.text))
{
inpContent.placeholder.GetComponent<TMP_Text>().text = "";
}
}
private void UpdatePosition(int index)
{
transform.DOLocalMove(updatePosAndRotData[index].localPosition, doTweenTime);
@ -179,6 +180,9 @@ namespace HK
public override void OnDispose()
{
base.OnDispose();
EventManager.Instance.Unsubscribe(Product_DesignCover_SetShowEventArgs.EventId,
Product_DesignCover_SetShowEvent);
EventManager.Instance.Unsubscribe(ProductIsShowDesignCoverEventArgs.EventId, ProductIsShowDesignCoverEvent);
EventManager.Instance.Unsubscribe(Product3SetTextPositionEventArgs.EventId, Product3SetTextPositionEvent);
EventManager.Instance.Unsubscribe(Product2GenStickerEventArgs.EventId, Product2GenStickerEvent);
EventManager.Instance.Unsubscribe(Product2DesignCoverClearEventArgs.EventId, Product2DesignCoverClearEvent);

View File

@ -20,7 +20,6 @@ namespace HK
[SerializeField] private NotebookColorBar NotebookColorBar;
[SerializeField] private CarouselImage CarouselImage;
[SerializeField] private Transform imgDesignParent;
[SerializeField] DesignCoverItem designCoverItem;
Book_M book;
public Action ClickAction;
@ -45,7 +44,6 @@ namespace HK
NotebookColorBar = GetValue<NotebookColorBar>("NotebookColorBar");
CarouselImage = GetValue<CarouselImage>("CarouselImage");
imgDesignParent = GetValue<Transform>("imgDesignParent");
designCoverItem = GetValue<DesignCoverItem>("DesignCover");
btnSticker.onClick.AddListener(OnClickbtnSticker);
@ -149,13 +147,13 @@ namespace HK
book.SetIndex(1);
EventManager.Instance.FireNow(this, new Product2SetDesignCoverPositionEventArgs(1));
InitSticker();
designCoverItem.IsOpenStickerTouch(true);
EventManager.Instance.FireNow(this, new Product_DesignCover_SetShowEventArgs(true, false));
}
public override void OnHide()
{
base.OnHide();
designCoverItem?.IsOpenStickerTouch(false);
EventManager.Instance.FireNow(this, new Product_DesignCover_SetShowEventArgs(false, false));
}
#region AutoGen_Method

View File

@ -14,7 +14,6 @@ namespace HK
[SerializeField] private Button btnPositionDown;
// [SerializeField] private TMP_InputField inpContent;
[SerializeField] private Keyboard.Keyboard keyboard;
[SerializeField] DesignCoverItem designCoverItem;
Book_M book;
public Action ClickAction;
@ -34,7 +33,6 @@ namespace HK
btnPositionDown = GetValue<Button>("btnPositionDown");
// inpContent = GetValue<TMP_InputField>("inpContent");
keyboard = GetValue<Keyboard.Keyboard>("Keyboard");
designCoverItem = GetValue<DesignCoverItem>("DesignCover");
btnPositionUp.onClick.AddListener(OnClickbtnPositionUp);
btnPositionMiddle.onClick.AddListener(OnClickbtnPositionMiddle);
@ -61,17 +59,14 @@ namespace HK
{
base.OnShow();
book.SetIndex(2);
// inpContent.gameObject.SetActive(true);
designCoverItem.SetTextTarget();
designCoverItem.CheckShow();
EventManager.Instance.FireNow(this, new Product_DesignCover_SetShowEventArgs(false, true));
EventManager.Instance.FireNow(this,new Product2SetDesignCoverPositionEventArgs(2));
}
public override void OnHide()
{
base.OnHide();
// inpContent?.gameObject.SetActive(false);
designCoverItem?.CheckHide();
}
#region AutoGen_Method

View File

@ -60,6 +60,7 @@ namespace HK
public override void OnDispose()
{
base.OnDispose();
EventManager.Instance.Unsubscribe(BookPlayAnimatorFinishEventArgs.EventId,BookPlayAnimatorFinishEvent);
#region AutoGen_Dispose

View File

@ -42,7 +42,7 @@ namespace HK
{
base.OnShow();
droChooseLanguage.value = (int)LanguageManager.Instance.type;
txtShoppingCartCount.text = GameData.Instance.shoppingCart.totalQuantity;
txtShoppingCartCount.text = ShoppingCartManager.Instance.ShoppingCart.totalQuantity;
}
#region AutoGen_Method

View File

@ -1,62 +0,0 @@
using UnityEngine.UI;
using TMPro;
using UnityEngine;
namespace HK
{
public class goUpMenuItem : UIItemBase
{
[SerializeField] private Button btnHome;
[SerializeField] private Button btnReturn;
[SerializeField] private Button btnShoppingCart;
[SerializeField] private TMP_Text txtShoppingCartCount;
[SerializeField] private TMP_Dropdown droChooseLanguage;
public override void OnInit()
{
base.OnInit();
#region AutoGen_Init
btnHome = GetValue<Button>("btnHome");
btnReturn = GetValue<Button>("btnReturn");
btnShoppingCart = GetValue<Button>("btnShoppingCart");
txtShoppingCartCount = GetValue<TMP_Text>("txtShoppingCartCount");
droChooseLanguage = GetValue<TMP_Dropdown>("droChooseLanguage");
btnHome.onClick.AddListener(OnClickbtnHome);
btnReturn.onClick.AddListener(OnClickbtnReturn);
btnShoppingCart.onClick.AddListener(OnClickbtnShoppingCart);
droChooseLanguage.onValueChanged.AddListener(OnValueChangeddroChooseLanguage);
#endregion
}
#region AutoGen_Method
private void OnClickbtnHome() {}
private void OnClickbtnReturn() {}
private void OnClickbtnShoppingCart() {}
private void OnValueChangeddroChooseLanguage(int i) {}
#endregion
public override void OnDispose()
{
base.OnDispose();
#region AutoGen_Dispose
btnHome.onClick.RemoveListener(OnClickbtnHome);
btnReturn.onClick.RemoveListener(OnClickbtnReturn);
btnShoppingCart.onClick.RemoveListener(OnClickbtnShoppingCart);
droChooseLanguage.onValueChanged.RemoveListener(OnValueChangeddroChooseLanguage);
btnHome = null;
btnReturn = null;
btnShoppingCart = null;
txtShoppingCartCount = null;
droChooseLanguage = null;
#endregion
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 27bb826a03170d34dabe3f6277aad10f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,3 +1,4 @@
using Runtime;
using UnityEngine.UI;
using TMPro;
using UnityEngine;
@ -6,49 +7,66 @@ namespace HK
{
public class PrintReceiptUI : UIBase
{
[SerializeField] private TMP_Text txtName;
[SerializeField] private TMP_Text txtOrderID;
[SerializeField] private Button btnConfirm;
[SerializeField] private Button btnReprintReceipt;
[SerializeField] private TMP_Text txtWaitPrinter;
[SerializeField] private TMP_Text txtName;
[SerializeField] private TMP_Text txtOrderID;
[SerializeField] private Button btnConfirm;
[SerializeField] private Button btnReprintReceipt;
[SerializeField] private TMP_Text txtWaitPrinter;
public override void OnInit()
{
base.OnInit();
#region AutoGen_Init
txtName = GetValue<TMP_Text>("txtName");
txtOrderID = GetValue<TMP_Text>("txtOrderID");
btnConfirm = GetValue<Button>("btnConfirm");
btnReprintReceipt = GetValue<Button>("btnReprintReceipt");
txtWaitPrinter = GetValue<TMP_Text>("txtWaitPrinter");
txtName = GetValue<TMP_Text>("txtName");
txtOrderID = GetValue<TMP_Text>("txtOrderID");
btnConfirm = GetValue<Button>("btnConfirm");
btnReprintReceipt = GetValue<Button>("btnReprintReceipt");
txtWaitPrinter = GetValue<TMP_Text>("txtWaitPrinter");
btnConfirm.onClick.AddListener(OnClickbtnConfirm);
btnReprintReceipt.onClick.AddListener(OnClickbtnReprintReceipt);
btnConfirm.onClick.AddListener(OnClickbtnConfirm);
btnReprintReceipt.onClick.AddListener(OnClickbtnReprintReceipt);
#endregion
}
public override void OnOpen()
{
base.OnOpen();
txtWaitPrinter.gameObject.SetActive(true);
btnConfirm.gameObject.SetActive(false);
btnReprintReceipt.gameObject.SetActive(false);
txtName.text = ShoppingCartManager.Instance.ShoppingCart.userName;
}
#region AutoGen_Method
private void OnClickbtnConfirm() {}
private void OnClickbtnReprintReceipt() {}
private void OnClickbtnConfirm()
{
}
private void OnClickbtnReprintReceipt()
{
}
#endregion
public override void OnDispose()
{
base.OnDispose();
#region AutoGen_Dispose
btnConfirm.onClick.RemoveListener(OnClickbtnConfirm);
btnReprintReceipt.onClick.RemoveListener(OnClickbtnReprintReceipt);
btnConfirm.onClick.RemoveListener(OnClickbtnConfirm);
btnReprintReceipt.onClick.RemoveListener(OnClickbtnReprintReceipt);
txtName = null;
txtOrderID = null;
btnConfirm = null;
btnReprintReceipt = null;
txtWaitPrinter = null;
txtName = null;
txtOrderID = null;
btnConfirm = null;
btnReprintReceipt = null;
txtWaitPrinter = null;
#endregion
}

View File

@ -19,6 +19,7 @@ namespace HK
[SerializeField] private Product3TextItem Product3Text;
[SerializeField] private Product4LineItem Product4Line;
[SerializeField] private Product5ConfirmItem Product5Confirm;
[SerializeField] private DesignCoverItem designCoverItem;
GameObject model;
Book_M book;
@ -41,6 +42,7 @@ namespace HK
Product3Text = GetValue<Product3TextItem>("Product3Text");
Product4Line = GetValue<Product4LineItem>("Product4Line");
Product5Confirm = GetValue<Product5ConfirmItem>("Product5Confirm");
designCoverItem = GetValue<DesignCoverItem>("DesignCover");
btnStepDesign.onClick.AddListener(OnValueChangedtogStepDesign);
btnStepText.onClick.AddListener(OnValueChangedtogStepText);
@ -64,14 +66,14 @@ namespace HK
var cartData = new ShoppingCartData()
{
bookAmount = informationData.BookPrice,
bookAmount = informationData.BookPrice+informationData.DesignPrice,
bookName = informationData.BookEnglishName,
bookDiscount = informationData.Discount,
bookDiscount = informationData.DiscountPrice,
count = 1,
previewImage = bytes
};
ShoppingCartManager.Instance.AddToCart(cartData);
UIManager.Instance.ShowUI(nameof(ShoppingCartUI));
UIManager.Instance.ShowUIOnly(nameof(ShoppingCartUI));
}
public override void OnOpen()
@ -89,6 +91,7 @@ namespace HK
Product4Line.SetBook(book);
Product5Confirm.SetBook(book);
Product1Color.OnShow();
designCoverItem.OnShow();
index = 1;
EventManager.Instance.FireNow(this, new ProductIsShowDesignCoverEventArgs(true));
}
@ -251,6 +254,12 @@ namespace HK
Product3Text.ClickAction -= ClickNext;
Product4Line.ClickAction -= ClickNext;
Product5Confirm.ClickAction -= ClickDesignFinish;
Product1Color.OnDispose();
Product2Sticker.OnDispose();
Product3Text.OnDispose();
Product4Line.OnDispose();
Product5Confirm.OnDispose();
designCoverItem.OnDispose();
#region AutoGen_Dispose

View File

@ -75,25 +75,34 @@ namespace HK
void UpdateShoppingCart()
{
foreach (var item in items)
{
GameObject.Destroy(item.gameObject);
}
items.Clear();
var shoppingCart = ShoppingCartManager.Instance.ShoppingCart;
float quantity = 0;
float subtotal = 0;
float discount = 0;
float amount = 0;
foreach (var cartData in shoppingCart.datas)
{
Gen(cartData);
quantity += cartData.count;
subtotal += cartData.bookAmount * cartData.count;
discount += cartData.bookDiscount * cartData.count;
amount += cartData.bookAmount * cartData.count - cartData.bookDiscount * cartData.count;
}
txtQuantity.text = $"{quantity}";
txtSubtotal.text = $"{subtotal}";
txtDiscount.text = $"{discount}";
txtAmount.text = $"{amount}";
txtQuantity.text = $"{shoppingCart.totalQuantity}";
txtSubtotal.text = $"{shoppingCart.itemsSubTotal}";
txtDiscount.text = $"{shoppingCart.discount}";
txtAmount.text = $"{shoppingCart.totalAmount}";
}
void OnlyUpdateMsg()
{
var shoppingCart = ShoppingCartManager.Instance.ShoppingCart;
txtQuantity.text = $"{shoppingCart.totalQuantity}";
txtSubtotal.text = $"{shoppingCart.itemsSubTotal}";
txtDiscount.text = $"{shoppingCart.discount}";
txtAmount.text = $"{shoppingCart.totalAmount}";
}
void Gen(ShoppingCartData shoppingCartData)
@ -101,6 +110,7 @@ namespace HK
var go = GameObject.Instantiate(commodityItem, scrollRect.content);
var item = go.GetComponent<CommodityItem>();
item.SetData(shoppingCartData);
item.OnUpdateCallback += OnlyUpdateMsg;
go.SetActive(true);
items.Add(item);
}
@ -109,6 +119,7 @@ namespace HK
private void OnClickbtnConfirm()
{
UIManager.Instance.ShowUIOnly(nameof(SubmitMessageUI));
}
#endregion
@ -118,6 +129,10 @@ namespace HK
base.OnDispose();
goUpMenu.OnClickReturn -= ClickReturn;
EventManager.Instance.Unsubscribe(AddCommodityToShoppingCartEventArgs.EventId,
AddCommodityToShoppingCartEvent);
EventManager.Instance.Unsubscribe(ClearShoppingCartEventArgs.EventId, ClearShoppingCartEvent);
#region AutoGen_Dispose
btnConfirm.onClick.RemoveListener(OnClickbtnConfirm);

View File

@ -1,3 +1,4 @@
using Runtime;
using UnityEngine.UI;
using TMPro;
using UnityEngine;
@ -13,7 +14,7 @@ namespace HK
[SerializeField] private TMP_Text txtModileError;
[SerializeField] private TMP_InputField inpEmail;
[SerializeField] private Toggle togIsAgree;
[SerializeField] private Image btnNext;
[SerializeField] private Button btnNext;
[SerializeField] private Image Keyboard_Name;
[SerializeField] private Image Keyboard_Mobile;
[SerializeField] private Image Keyboard_Email;
@ -31,12 +32,13 @@ namespace HK
txtModileError = GetValue<TMP_Text>("txtModileError");
inpEmail = GetValue<TMP_InputField>("inpEmail");
togIsAgree = GetValue<Toggle>("togIsAgree");
btnNext = GetValue<Image>("btnNext");
btnNext = GetValue<Button>("btnNext");
Keyboard_Name = GetValue<Image>("Keyboard_Name");
Keyboard_Mobile = GetValue<Image>("Keyboard_Mobile");
Keyboard_Email = GetValue<Image>("Keyboard_Email");
togIsAgree.onValueChanged.AddListener(OnValueChangedtogIsAgree);
btnNext.onClick.AddListener(OnCilckbtnNext);
#endregion
@ -50,6 +52,15 @@ namespace HK
#region AutoGen_Method
private void OnCilckbtnNext()
{
ShoppingCartManager.Instance.ShoppingCart.userName = inpName.text;
ShoppingCartManager.Instance.ShoppingCart.userModie = inpMobile.text;
ShoppingCartManager.Instance.ShoppingCart.userEmail = inpEmail.text;
ShoppingCartManager.Instance.ShoppingCart.isAgreeSubscribe = togIsAgree.isOn;
UIManager.Instance.ShowUIOnly(nameof(PrintReceiptUI));
}
private void OnValueChangedtogIsAgree(bool b)
{
}
@ -59,10 +70,12 @@ namespace HK
public override void OnDispose()
{
base.OnDispose();
goUpMenu.OnClickReturn += Return;
#region AutoGen_Dispose
togIsAgree.onValueChanged.RemoveListener(OnValueChangedtogIsAgree);
btnNext.onClick.RemoveListener(OnCilckbtnNext);
goUpMenu = null;
inpName = null;

View File

@ -1,5 +1,5 @@
{
"wc": "2025/5/8",
"ThemeIndex": "1",
"ProductIndex": "1001"
"ProductIndex": "1002"
}