feat: mini game tutorial, popup ready, end game result

master
tiendat3699 2024-04-18 10:53:46 +07:00
parent e44cb2e194
commit 1da0dc3c9b
35 changed files with 4320 additions and 1299 deletions

View File

@ -75,7 +75,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 10
m_Sprite: {fileID: 21300000, guid: 3d49ec4db456aae489a64f87a7f8c41a, type: 3} m_Sprite: {fileID: 21300000, guid: 3d49ec4db456aae489a64f87a7f8c41a, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0

View File

@ -75,7 +75,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 10
m_Sprite: {fileID: 21300000, guid: 852b2a010a192e14ba422d8439924394, type: 3} m_Sprite: {fileID: 21300000, guid: 852b2a010a192e14ba422d8439924394, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0

View File

@ -75,7 +75,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 10
m_Sprite: {fileID: 21300000, guid: 8905195cf6610e845bcea98533c62e2f, type: 3} m_Sprite: {fileID: 21300000, guid: 8905195cf6610e845bcea98533c62e2f, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0

View File

@ -75,7 +75,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 10
m_Sprite: {fileID: 21300000, guid: e763b6904e117d64c83d25b547971a76, type: 3} m_Sprite: {fileID: 21300000, guid: e763b6904e117d64c83d25b547971a76, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0

View File

@ -75,7 +75,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 10
m_Sprite: {fileID: 21300000, guid: 98372b81067ee6446acaa5b4435cf606, type: 3} m_Sprite: {fileID: 21300000, guid: 98372b81067ee6446acaa5b4435cf606, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0

View File

@ -75,7 +75,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 10
m_Sprite: {fileID: 21300000, guid: 71b236d6bd7a5c44c803f532106636ec, type: 3} m_Sprite: {fileID: 21300000, guid: 71b236d6bd7a5c44c803f532106636ec, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1} m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -123,6 +123,426 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!1 &248596664
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 248596665}
- component: {fileID: 248596667}
- component: {fileID: 248596666}
m_Layer: 5
m_Name: Content
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &248596665
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 248596664}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 316372143}
- {fileID: 1234349474}
m_Father: {fileID: 1334958687}
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: 800, y: 1000}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &248596666
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 248596664}
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!222 &248596667
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 248596664}
m_CullTransparentMesh: 1
--- !u!1 &277971173
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 277971174}
- component: {fileID: 277971176}
- component: {fileID: 277971175}
m_Layer: 5
m_Name: Time
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &277971174
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 277971173}
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: 1234349474}
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: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &277971175
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 277971173}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 5
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4284678401
m_fontColor: {r: 0.003921569, g: 0.003921569, b: 0.38823533, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 150
m_fontSizeBase: 150
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &277971176
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 277971173}
m_CullTransparentMesh: 1
--- !u!1 &316372142
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 316372143}
- component: {fileID: 316372145}
- component: {fileID: 316372144}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &316372143
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 316372142}
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: 248596665}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -200}
m_SizeDelta: {x: -200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &316372144
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 316372142}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Keep hands up!
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278190080
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 80
m_fontSizeBase: 80
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &316372145
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 316372142}
m_CullTransparentMesh: 1
--- !u!1 &330465836
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 330465837}
- component: {fileID: 330465839}
- component: {fileID: 330465838}
m_Layer: 5
m_Name: bg
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &330465837
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330465836}
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: 1334958687}
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 &330465838
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330465836}
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.5882353}
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!222 &330465839
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330465836}
m_CullTransparentMesh: 1
--- !u!1 &535544408 --- !u!1 &535544408
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -266,6 +686,158 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 731571811} m_GameObject: {fileID: 731571811}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &907378027
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 907378028}
- component: {fileID: 907378030}
- component: {fileID: 907378029}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &907378028
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 907378027}
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: 1234349474}
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!114 &907378029
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 907378027}
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: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: -2413806693520163455, guid: 36fd3ea26f8ff1c408d44ad5572d7218, 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!222 &907378030
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 907378027}
m_CullTransparentMesh: 1
--- !u!1 &1234349473
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1234349474}
- component: {fileID: 1234349476}
- component: {fileID: 1234349475}
m_Layer: 5
m_Name: Fill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1234349474
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1234349473}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 907378028}
- {fileID: 277971174}
m_Father: {fileID: 248596665}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 150}
m_SizeDelta: {x: 250, y: 250}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1234349475
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1234349473}
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.003921569, g: 0.003921569, b: 0.40000004, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: -2413806693520163455, guid: 36fd3ea26f8ff1c408d44ad5572d7218, type: 3}
m_Type: 3
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 0.5
m_FillClockwise: 1
m_FillOrigin: 2
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1234349476
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1234349473}
m_CullTransparentMesh: 1
--- !u!1 &1302683599 --- !u!1 &1302683599
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -358,6 +930,73 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1334958686
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1334958687}
- component: {fileID: 1334958688}
- component: {fileID: 1334958689}
m_Layer: 5
m_Name: ReadyPopup
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1334958687
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1334958686}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 330465837}
- {fileID: 248596665}
m_Father: {fileID: 1939570967}
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 &1334958688
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1334958686}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 34f71be9834244dba3acea51df2798bd, type: 3}
m_Name:
m_EditorClassIdentifier:
_time: {fileID: 277971175}
_fillImage: {fileID: 1234349475}
_content: {fileID: 248596665}
_canvasGroup: {fileID: 1334958689}
--- !u!225 &1334958689
CanvasGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1334958686}
m_Enabled: 1
m_Alpha: 0
m_Interactable: 0
m_BlocksRaycasts: 0
m_IgnoreParentGroups: 0
--- !u!1 &1388120848 --- !u!1 &1388120848
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -529,7 +1168,7 @@ Canvas:
m_OverridePixelPerfect: 0 m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0 m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0 m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 0 m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0 m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingOrder: 0 m_SortingOrder: 0
@ -547,6 +1186,7 @@ RectTransform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 731571812} - {fileID: 731571812}
- {fileID: 1334958687}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,15 @@
using System;
using GadGame.SO; using GadGame.SO;
using GadGame.State; using GadGame.State;
using GadGame.State.MainFlowState; using GadGame.State.MainFlowState;
namespace GadGame namespace GadGame
{ {
public class MainFlow : StateRunner<MainFlow> public class MainFlow : SingletonStateRunner<MainFlow>
{ {
public SceneFlowConfig SceneFlowConfig; public SceneFlowConfig SceneFlowConfig;
public event Action<float> OnReadyCountDown;
public event Action<bool> OnReady;
protected override void Awake() protected override void Awake()
{ {
@ -18,5 +21,15 @@ namespace GadGame
{ {
SetState<IdleState>(); SetState<IdleState>();
} }
public void ReadyCountDown(float duration)
{
OnReadyCountDown?.Invoke(duration);
}
public void Ready(bool ready)
{
OnReady?.Invoke(ready);
}
} }
} }

View File

@ -9,7 +9,7 @@ namespace GadGame.Manager
public class GameManager : Singleton.Singleton<GameManager> public class GameManager : Singleton.Singleton<GameManager>
{ {
private int _score; private int _score;
public int Score => _score;
public event Action OnEnd; public event Action OnEnd;
public event Action OnPause; public event Action OnPause;
public event Action OnResume; public event Action OnResume;

View File

@ -1,4 +1,3 @@
using System;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using DG.Tweening; using DG.Tweening;
using GadGame.Singleton; using GadGame.Singleton;
@ -18,46 +17,46 @@ namespace GadGame.Manager
public async void LoadSceneWithTransition(int sceneIndex, float transitionDuration = 1) public async void LoadSceneWithTransition(int sceneIndex, float transitionDuration = 1)
{ {
await _transitionCanvasGroup.DOFade(1, transitionDuration); await _transitionCanvasGroup.DOFade(1, transitionDuration).SetUpdate(true);
var asyncOperation = SceneManager.LoadSceneAsync(sceneIndex); var asyncOperation = SceneManager.LoadSceneAsync(sceneIndex);
asyncOperation.allowSceneActivation = false; asyncOperation.allowSceneActivation = false;
await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f); await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f);
await UniTask.Delay(200); await UniTask.Delay(200, ignoreTimeScale:true);
asyncOperation.allowSceneActivation = true; asyncOperation.allowSceneActivation = true;
await _transitionCanvasGroup.DOFade(0, transitionDuration); await _transitionCanvasGroup.DOFade(0, transitionDuration).SetUpdate(true);;
} }
public async UniTask LoadSceneWithTransitionAsync(int sceneIndex, float transitionDuration = 1) public async UniTask LoadSceneWithTransitionAsync(int sceneIndex, float transitionDuration = 1)
{ {
await _transitionCanvasGroup.DOFade(1, transitionDuration/2); await _transitionCanvasGroup.DOFade(1, transitionDuration/2).SetUpdate(true);;
var asyncOperation = SceneManager.LoadSceneAsync(sceneIndex); var asyncOperation = SceneManager.LoadSceneAsync(sceneIndex);
asyncOperation.allowSceneActivation = false; asyncOperation.allowSceneActivation = false;
await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f); await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f);
await UniTask.Delay(200); await UniTask.Delay(200, ignoreTimeScale:true);
asyncOperation.allowSceneActivation = true; asyncOperation.allowSceneActivation = true;
await _transitionCanvasGroup.DOFade(0, transitionDuration/2); await _transitionCanvasGroup.DOFade(0, transitionDuration/2).SetUpdate(true);;
} }
public async void LoadSceneWithTransition(string scenePath, float transitionDuration = 1) public async void LoadSceneWithTransition(string scenePath, float transitionDuration = 1)
{ {
await _transitionCanvasGroup.DOFade(1, transitionDuration/2); await _transitionCanvasGroup.DOFade(1, transitionDuration/2).SetUpdate(true);;
var asyncOperation = SceneManager.LoadSceneAsync(scenePath); var asyncOperation = SceneManager.LoadSceneAsync(scenePath);
asyncOperation.allowSceneActivation = false; asyncOperation.allowSceneActivation = false;
await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f); await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f);
await UniTask.Delay(200); await UniTask.Delay(200, ignoreTimeScale:true);
asyncOperation.allowSceneActivation = true; asyncOperation.allowSceneActivation = true;
await _transitionCanvasGroup.DOFade(0, transitionDuration/2); await _transitionCanvasGroup.DOFade(0, transitionDuration/2).SetUpdate(true);;
} }
public async UniTask LoadSceneWithTransitionAsync(string scenePath, float transitionDuration = 1) public async UniTask LoadSceneWithTransitionAsync(string scenePath, float transitionDuration = 1)
{ {
await _transitionCanvasGroup.DOFade(1, transitionDuration/2); await _transitionCanvasGroup.DOFade(1, transitionDuration/2).SetUpdate(true);;
var asyncOperation = SceneManager.LoadSceneAsync(scenePath); var asyncOperation = SceneManager.LoadSceneAsync(scenePath);
asyncOperation.allowSceneActivation = false; asyncOperation.allowSceneActivation = false;
await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f); await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f);
await UniTask.Delay(200); await UniTask.Delay(200, ignoreTimeScale:true);
asyncOperation.allowSceneActivation = true; asyncOperation.allowSceneActivation = true;
await _transitionCanvasGroup.DOFade(0, transitionDuration/2); await _transitionCanvasGroup.DOFade(0, transitionDuration/2).SetUpdate(true);;
} }
} }
} }

View File

@ -6,11 +6,11 @@ using UnityEngine;
namespace GadGame.Manager namespace GadGame.Manager
{ {
public class PopupManager : PersistentSingleton<PopupManager> public class PopupManager : PersistentSingleton<PopupManager>
{ {
[SerializeField] private Popup _popupPrefab; [SerializeField] private Popup _popupPrefab;
private Popup _popup; private Popup _popup;
private CancellationTokenSource _cancellationTokenSource;
protected override void Awake() protected override void Awake()
{ {
@ -19,21 +19,22 @@ namespace GadGame.Manager
_popup.gameObject.SetActive(false); _popup.gameObject.SetActive(false);
} }
public async void Show(string message, int duration, Action onDone = null) public Popup Show(string message)
{
Show(message, 0).SetStay(true);
return _popup;
}
public Popup Show(string message, float duration)
{ {
_cancellationTokenSource = new CancellationTokenSource();
_popup.gameObject.SetActive(true); _popup.gameObject.SetActive(true);
_popup.Show(message); _popup.Show(message, duration * 1000);
if (duration == -1) return; return _popup;
await UniTask.Delay(duration * 1000, cancellationToken: _cancellationTokenSource.Token);
_popup.Hide();
onDone?.Invoke();
} }
public void Hide() public void Hide()
{ {
_popup.gameObject.SetActive(true); _popup.gameObject.SetActive(true);
_cancellationTokenSource.Cancel();
_popup.Hide(); _popup.Hide();
} }
} }

View File

@ -1,3 +1,5 @@
using Cysharp.Threading.Tasks;
using DG.Tweening;
using GadGame.Manager; using GadGame.Manager;
using GadGame.Network; using GadGame.Network;
using GadGame.State; using GadGame.State;
@ -24,6 +26,15 @@ namespace GadGame.MiniGame
[SerializeField] private Canvas _canvas; [SerializeField] private Canvas _canvas;
[SerializeField] private TextMeshProUGUI _time; [SerializeField] private TextMeshProUGUI _time;
[SerializeField] private TextMeshProUGUI _score; [SerializeField] private TextMeshProUGUI _score;
[SerializeField] private TextMeshProUGUI _resultScore;
[SerializeField] private CanvasGroup _result;
[Header("Tutorial")]
[SerializeField] private GameObject _tutorialWrapper;
[SerializeField] private Transform _thisYou;
[SerializeField] private Transform _right;
[SerializeField] private Transform _left;
[SerializeField] private Transform _end;
[Header("Pool")] [Header("Pool")]
[SerializeField] private Pool<Item>[] _itemPools; [SerializeField] private Pool<Item>[] _itemPools;
@ -40,8 +51,8 @@ namespace GadGame.MiniGame
_gameManager.OnResume += Resume; _gameManager.OnResume += Resume;
_gameManager.OnScoreUpdate += OnScoreUpdate; _gameManager.OnScoreUpdate += OnScoreUpdate;
_camera = Camera.main; _camera = Camera.main;
SetState<PlayingGameState>();
_time.text = GameTime.ToString(); _time.text = GameTime.ToString();
SetState<TutorialGameState>();
} }
public void SpawnRandomItem() public void SpawnRandomItem()
@ -93,17 +104,36 @@ namespace GadGame.MiniGame
} }
} }
public void ReleaseAllItem() public async void ShowTutorial()
{ {
// foreach (var pool in _bombPools) _tutorialWrapper.SetActive(true);
// { _thisYou.localScale = Vector3.zero;
// pool.Clear(); _right.localScale = Vector3.zero;
// } _left.localScale = Vector3.zero;
// _end.localScale = Vector3.zero;
// foreach (var pool in _itemPools) await _thisYou.DOScale(Vector3.one, 0.2f);
// { await UniTask.Delay(2000);
// pool.Clear(); await _right.DOScale(Vector3.one, 0.2f).OnStart(()=> _thisYou.DOScale(Vector3.zero, 0.2f));
// } await UniTask.WaitUntil(() => _basket.position.x >= 1.5f);
await _left.DOScale(Vector3.one, 0.2f).OnStart(()=> _right.DOScale(Vector3.zero, 0.2f));
await UniTask.WaitUntil(() => _basket.position.x <= -1.5f);
await _left.DOScale(Vector3.zero, 0.2f);
await _end.DOScale(Vector3.one, 0.2f);
await UniTask.Delay(2000);
await _end.DOScale(Vector3.zero, 0.2f);
_tutorialWrapper.SetActive(false);
SetState<PlayingGameState>();
}
public async void ShowResult()
{
await _result.DOFade(1, 0.3f);
await _resultScore.DOText(_gameManager.Score.ToString(), 1f, scrambleMode: ScrambleMode.Numerals);
}
public void DisableBasket()
{
_basket.GetComponent<Basket>().enabled = false;
} }
public void SetTextTime(float time) public void SetTextTime(float time)
@ -117,11 +147,13 @@ namespace GadGame.MiniGame
_gameManager.OnResume -= Resume; _gameManager.OnResume -= Resume;
} }
[Button, HideInEditorMode]
private void Pause() private void Pause()
{ {
SetState<PauseGameState>(); SetState<PauseGameState>();
} }
[Button, HideInEditorMode]
private void Resume() private void Resume()
{ {
SetState<ResumeGameState>(); SetState<ResumeGameState>();

View File

@ -15,7 +15,7 @@ namespace GadGame.Network
public bool OnVision; public bool OnVision;
public bool Engage; public bool Engage;
public bool Ready; public bool Ready;
public Genders Gender; public string Gender;
public int AgeMin; public int AgeMin;
public int AgeMax; public int AgeMax;
public Vector2 PosPoint; public Vector2 PosPoint;

View File

@ -1,3 +1,5 @@
using System;
using System.Threading;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using DG.Tweening; using DG.Tweening;
using TMPro; using TMPro;
@ -11,23 +13,73 @@ namespace GadGame
[SerializeField] private CanvasGroup _canvasGroup; [SerializeField] private CanvasGroup _canvasGroup;
[SerializeField] private Transform _content; [SerializeField] private Transform _content;
public async void Show(string message) private float _duration;
private Action _onComplete;
private Action<float> _onRun;
private bool _active = false;
private CancellationTokenSource _cancellationTokenSource;
private bool _stay;
private async void PopupUpdate()
{ {
while (_active)
{
await UniTask.Delay(100, cancellationToken:_cancellationTokenSource.Token, ignoreTimeScale: true);
if (!_stay)
{
_duration -= 100;
if (_duration <= 0)
{
Hide();
}
}
_onRun?.Invoke(_duration);
}
}
public void SetStay(bool value)
{
_stay = value;
}
public async void Show(string message, float duration)
{
_active = true;
_duration = duration;
_stay = false;
_cancellationTokenSource = new CancellationTokenSource();
_content.DOComplete(); _content.DOComplete();
_canvasGroup.DOComplete(); _canvasGroup.DOComplete();
_message.text = message; _message.text = message;
_canvasGroup.alpha = 0; _canvasGroup.alpha = 0;
_content.localScale = Vector3.zero; _content.localScale = Vector3.zero;
await _canvasGroup.DOFade(1, 0.3f); await _canvasGroup.DOFade(1, 0.3f).SetUpdate(true);
await _content.DOScale(Vector3.one, 0.5f); await _content.DOScale(Vector3.one, 0.5f).SetUpdate(true);
PopupUpdate();
} }
public async void Hide() public async void Hide()
{ {
_active = false;
_duration = 0;
_cancellationTokenSource.Cancel();
_content.DOComplete(); _content.DOComplete();
_canvasGroup.DOComplete(); _canvasGroup.DOComplete();
await _content.DOScale(Vector3.zero, 0.3f); await _content.DOScale(Vector3.zero, 0.3f).SetUpdate(true);
await _canvasGroup.DOFade(0, 0.3f); await _canvasGroup.DOFade(0, 0.3f).SetUpdate(true);
_onComplete?.Invoke();
_onComplete = null;
_onRun = null;
}
public void OnComplete(Action action)
{
_onComplete = action;
}
public void OnRun(Action<float> action)
{
_onRun = action;
} }
} }
} }

View File

@ -0,0 +1,55 @@
using System;
using Cysharp.Threading.Tasks;
using DG.Tweening;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace GadGame
{
public class ReadyPopUp : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI _time;
[SerializeField] private Image _fillImage;
[SerializeField] private Transform _content;
[SerializeField] private CanvasGroup _canvasGroup;
private float _readyTime;
private MainFlow _mainFlow;
private void Start()
{
_mainFlow = MainFlow.Instance;
_mainFlow.OnReadyCountDown += OnReadyCountdown;
_mainFlow.OnReady += OnReady;
_content.localScale = Vector3.zero;
}
private void OnDestroy()
{
_canvasGroup.DOKill();
_content.DOKill();
}
private async void OnReady(bool ready)
{
if (ready)
{
await _canvasGroup.DOFade(1, 0.1f);
await _content.DOScale(Vector3.one, 0.2f);
}
else
{
await _content.DOScale(Vector3.zero, 0.2f);
await _canvasGroup.DOFade(0, 0.1f);
}
}
private void OnReadyCountdown(float duration)
{
_time.text = Mathf.CeilToInt(duration).ToString();
_readyTime = 5 - duration;
_fillImage.fillAmount = _readyTime / 5;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 34f71be9834244dba3acea51df2798bd
timeCreated: 1713406102

View File

@ -10,8 +10,10 @@ namespace GadGame.State.GameState
public override async void Enter() public override async void Enter()
{ {
Debug.Log("End Game"); Debug.Log("End Game");
Runner.ReleaseAllItem(); Runner.DisableBasket();
await UniTask.Delay(3000); await UniTask.Delay(1000);
Runner.ShowResult();
await UniTask.Delay(4000);
GameManager.Instance.EndGame(); GameManager.Instance.EndGame();
} }

View File

@ -8,6 +8,7 @@ namespace GadGame.State.GameState
public override void Enter() public override void Enter()
{ {
Debug.Log("Pause Game"); Debug.Log("Pause Game");
Time.timeScale = 0;
} }
public override void Update(float time) public override void Update(float time)

View File

@ -8,6 +8,7 @@ namespace GadGame.State.GameState
public override void Enter() public override void Enter()
{ {
Debug.Log("Resume Game"); Debug.Log("Resume Game");
Time.timeScale = 1;
Runner.SetState<PlayingGameState>(); Runner.SetState<PlayingGameState>();
} }

View File

@ -0,0 +1,28 @@
using GadGame.MiniGame;
namespace GadGame.State.GameState
{
public class TutorialGameState : State<MiniGameController>
{
private bool _turnedRight;
private bool _turnedLeft;
public override void Enter()
{
Runner.ShowTutorial();
}
public override void Update(float time)
{
if (time > 2)
{
Runner.PlayerControl();
}
}
public override void Exit()
{
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 07eebb79a5434674a49ad5551d2b9ce5
timeCreated: 1713408568

View File

@ -17,9 +17,24 @@ namespace GadGame.State.MainFlowState
if (!UdpSocket.Instance.DataReceived.PassBy) if (!UdpSocket.Instance.DataReceived.PassBy)
{ {
_noPassByTimer += Time.deltaTime; _noPassByTimer += Time.deltaTime;
if (_noPassByTimer >= 10) if (_noPassByTimer >= 5)
{
if(!UdpSocket.Instance.DataReceived.PassBy)
{ {
Runner.SetState<IdleState>(); Runner.SetState<IdleState>();
return;
}
if(!UdpSocket.Instance.DataReceived.OnVision)
{
Runner.SetState<PassByState>();
return;
}
if(!UdpSocket.Instance.DataReceived.Engage)
{
Runner.SetState<ViewedState>();
return;
}
Runner.SetState<EngageState>();
} }
} }
else else

View File

@ -8,16 +8,64 @@ namespace GadGame.State.MainFlowState
{ {
private float _readyTimer; private float _readyTimer;
private bool _warned; private bool _warned;
private bool _showCountDown;
public override void Enter() public override void Enter()
{ {
LoadSceneManager.Instance.LoadSceneWithTransition(Runner.SceneFlowConfig.EndGageScene.ScenePath); LoadSceneManager.Instance.LoadSceneWithTransition(Runner.SceneFlowConfig.EndGageScene.ScenePath);
_readyTimer = 0; _readyTimer = 3;
} }
public override void Update(float time) public override void Update(float time)
{ {
if (time >= 2) if (time >= 2)
{
switch (_warned)
{
case false when !UdpSocket.Instance.DataReceived.PassBy:
Runner.SetState<IdleState>();
break;
case false when !UdpSocket.Instance.DataReceived.Engage:
_warned = true;
PopupManager.Instance.Show("Come Back", 5).OnComplete(OnWaringComplete);
break;
case true when UdpSocket.Instance.DataReceived.Engage:
_warned = false;
PopupManager.Instance.Hide();
break;
}
}
switch (_showCountDown)
{
case false when UdpSocket.Instance.DataReceived.Ready:
_showCountDown = true;
Runner.Ready(true);
break;
case true when !UdpSocket.Instance.DataReceived.Ready:
_showCountDown = false;
Runner.Ready(false);
break;
}
if (!UdpSocket.Instance.DataReceived.Ready) _readyTimer = 5;
_readyTimer -= Time.deltaTime;
if (_readyTimer <= 0)
{
_readyTimer = 0;
Runner.SetState<PlayGameState>();
}
Runner.ReadyCountDown(_readyTimer);
}
public override void Exit()
{
_warned = false;
}
private void OnWaringComplete()
{ {
if (!UdpSocket.Instance.DataReceived.PassBy) if (!UdpSocket.Instance.DataReceived.PassBy)
{ {
@ -25,32 +73,13 @@ namespace GadGame.State.MainFlowState
return; return;
} }
switch (_warned) if (!UdpSocket.Instance.DataReceived.OnVision)
{ {
case false when !UdpSocket.Instance.DataReceived.Engage: Runner.SetState<PassByState>();
_warned = true;
PopupManager.Instance.Show("Come Back", 5, () =>
{
Runner.SetState<ViewedState>();
});
return; return;
case true when UdpSocket.Instance.DataReceived.Engage:
_warned = false;
PopupManager.Instance.Hide();
return;
}
}
if (!UdpSocket.Instance.DataReceived.Ready) _readyTimer = 0;
_readyTimer += Time.deltaTime;
if (_readyTimer >= 3)
{
Runner.SetState<PlayGameState>();
}
} }
public override void Exit() Runner.SetState<ViewedState>();
{
_warned = false;
} }
} }
} }

View File

@ -14,9 +14,20 @@ namespace GadGame.State.MainFlowState
public override void Update(float time) public override void Update(float time)
{ {
if(time < 2) return; if(time < 2) return;
if (UdpSocket.Instance.DataReceived.Engage)
{
Runner.SetState<EngageState>();
return;
}
if (UdpSocket.Instance.DataReceived.OnVision)
{
Runner.SetState<ViewedState>();
return;
}
if (UdpSocket.Instance.DataReceived.PassBy) if (UdpSocket.Instance.DataReceived.PassBy)
{ {
Runner.SetState<PassByState>(); Runner.SetState<PassByState>();
return;
} }
} }

View File

@ -19,9 +19,17 @@ namespace GadGame.State.MainFlowState
Runner.SetState<IdleState>(); Runner.SetState<IdleState>();
return; return;
} }
if (UdpSocket.Instance.DataReceived.Engage)
{
Runner.SetState<EngageState>();
return;
}
if (UdpSocket.Instance.DataReceived.OnVision) if (UdpSocket.Instance.DataReceived.OnVision)
{ {
Runner.SetState<ViewedState>(); Runner.SetState<ViewedState>();
return;
} }
} }

View File

@ -15,6 +15,7 @@ namespace GadGame.State.MainFlowState
await LoadSceneManager.Instance.LoadSceneWithTransitionAsync(Runner.SceneFlowConfig.GameScene.ScenePath); await LoadSceneManager.Instance.LoadSceneWithTransitionAsync(Runner.SceneFlowConfig.GameScene.ScenePath);
_gameManager = GameManager.Instance; _gameManager = GameManager.Instance;
_gameManager.OnEnd += OnEndGame; _gameManager.OnEnd += OnEndGame;
_leaveTimer = 0;
} }
public override void Update(float time) public override void Update(float time)
@ -30,7 +31,7 @@ namespace GadGame.State.MainFlowState
_warned = true; _warned = true;
_leaveTimer = 0; _leaveTimer = 0;
_gameManager.Pause(); _gameManager.Pause();
PopupManager.Instance.Show("Where Are You?", 30, () => Runner.SetState<IdleState>()); PopupManager.Instance.Show("Where Are You?", 5).OnComplete(OnWaringComplete);
} }
return; return;
} }
@ -44,12 +45,33 @@ namespace GadGame.State.MainFlowState
public override void Exit() public override void Exit()
{ {
_warned = false;
} }
private void OnEndGame() private void OnEndGame()
{ {
Runner.SetState<RewardState>(); Runner.SetState<RewardState>();
} }
private void OnWaringComplete()
{
_gameManager.Resume();
if(!UdpSocket.Instance.DataReceived.PassBy)
{
Runner.SetState<IdleState>();
return;
}
if(!UdpSocket.Instance.DataReceived.OnVision)
{
Runner.SetState<PassByState>();
return;
}
if(!UdpSocket.Instance.DataReceived.Engage)
{
Runner.SetState<ViewedState>();
return;
}
Runner.SetState<EngageState>();
}
} }
} }

View File

@ -0,0 +1,77 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using GadGame.Singleton;
using Sirenix.OdinInspector;
using UnityEngine;
namespace GadGame.State
{
public class SingletonStateRunner<T> : Singleton<T> where T : MonoBehaviour
{
protected State<T> ActiveState;
#if UNITY_EDITOR
[ValueDropdown("AllStates")]
#endif
[SerializeField]
private List<string> _availableStates;
private List<State<T>> _states;
private float _timer;
#if UNITY_EDITOR
public IEnumerable AllStates
{
get
{
return Assembly.GetExecutingAssembly()
.GetTypes()
.Where(t => t.BaseType is { IsGenericType: true } &&
t.BaseType.GetGenericTypeDefinition() == typeof(State<>)).Select(t => t.FullName);
}
}
#endif
protected override void Awake()
{
base.Awake();
_states = new List<State<T>>();
foreach (var stateName in _availableStates)
{
var stateType = Assembly.GetExecutingAssembly().GetType(stateName);
var state = Activator.CreateInstance(stateType) as State<T>;
_states.Add(state);
state?.Init(GetComponent<T>());
}
}
protected virtual void Update()
{
if (ActiveState != null)
{
_timer += Time.deltaTime;
ActiveState.Update(_timer);
}
}
public void SetState<TSt>() where TSt : State<T>
{
if (ActiveState != null)
{
if (ActiveState is TSt) return;
ActiveState.Exit();
}
var newState = _states.FirstOrDefault(s => s is TSt);
if (newState == null) return;
ActiveState = newState;
ActiveState.Enter();
_timer = 0;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4e80db4b2cb740588d8701ea1d27a6c7
timeCreated: 1713405710

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -0,0 +1,255 @@
fileFormatVersion: 2
guid: 36fd3ea26f8ff1c408d44ad5572d7218
TextureImporter:
internalIDToNameTable:
- first:
213: -2413806693520163455
second: Circle
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 256
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Circle
rect:
serializedVersion: 2
x: 0
y: 0
width: 256
height: 256
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: 33, y: 128}
- {x: -33, y: 128}
- {x: -95, y: 95}
- {x: -128, y: 33}
- {x: -128, y: -33}
- {x: -95, y: -95}
- {x: -33, y: -128}
- {x: 33, y: -128}
- {x: 95, y: -95}
- {x: 128, y: -33}
- {x: 128, y: 33}
- {x: 95, y: 95}
physicsShape:
- - {x: 0, y: 128}
- {x: -39, y: 121}
- {x: -75, y: 103}
- {x: -103, y: 75}
- {x: -121, y: 39}
- {x: -128, y: 0}
- {x: -121, y: -39}
- {x: -103, y: -75}
- {x: -75, y: -103}
- {x: -39, y: -121}
- {x: 0, y: -128}
- {x: 39, y: -121}
- {x: 75, y: -103}
- {x: 103, y: -75}
- {x: 121, y: -39}
- {x: 128, y: 0}
- {x: 121, y: 39}
- {x: 103, y: 75}
- {x: 75, y: 103}
- {x: 39, y: 121}
tessellationDetail: 0
bones: []
spriteID: 18d3544e99f608ed0800000000000000
internalID: -2413806693520163455
vertices: []
indices:
edges: []
weights: []
outline:
- - {x: 33, y: 128}
- {x: -33, y: 128}
- {x: -95, y: 95}
- {x: -128, y: 33}
- {x: -128, y: -33}
- {x: -95, y: -95}
- {x: -33, y: -128}
- {x: 33, y: -128}
- {x: 95, y: -95}
- {x: 128, y: -33}
- {x: 128, y: 33}
- {x: 95, y: 95}
physicsShape:
- - {x: 0, y: 128}
- {x: -39, y: 121}
- {x: -75, y: 103}
- {x: -103, y: 75}
- {x: -121, y: 39}
- {x: -128, y: 0}
- {x: -121, y: -39}
- {x: -103, y: -75}
- {x: -75, y: -103}
- {x: -39, y: -121}
- {x: 0, y: -128}
- {x: 39, y: -121}
- {x: 75, y: -103}
- {x: 103, y: -75}
- {x: 121, y: -39}
- {x: 128, y: 0}
- {x: 121, y: 39}
- {x: 103, y: 75}
- {x: 75, y: 103}
- {x: 39, y: 121}
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
Circle: -2413806693520163455
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,195 @@
fileFormatVersion: 2
guid: 1238f3810b35f884189128dc4b87e372
TextureImporter:
internalIDToNameTable:
- first:
213: 7482667652216324306
second: Square
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 256
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Square
rect:
serializedVersion: 2
x: 0
y: 0
width: 256
height: 256
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 2d009a6b596c7d760800000000000000
internalID: 7482667652216324306
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape:
- - {x: -128, y: 128}
- {x: -128, y: -128}
- {x: 128, y: -128}
- {x: 128, y: 128}
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
Square: 7482667652216324306
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
"depth": 0, "depth": 0,
"source": "git", "source": "git",
"dependencies": {}, "dependencies": {},
"hash": "3c5b6a433fb8213d05d754e1c8dffb50542250f0" "hash": "ec68815a20a955e699fa613ce243cec12f820636"
}, },
"com.unity.2d.animation": { "com.unity.2d.animation": {
"version": "9.0.4", "version": "9.0.4",