From e2350f019b17dd50208498bb6f7015c612dfd066 Mon Sep 17 00:00:00 2001 From: Hazim Bin Ijaz Date: Tue, 22 Oct 2024 12:30:35 +0500 Subject: [PATCH] Added Score Logging in PlayFab --- Assets/PipeOut/Scenes/HomeScene.unity | 753 +++++++++--------- .../Resources/PlayFabSharedSettings.asset | 6 +- .../PlayFabSharedSettings.asset.meta | 4 +- Assets/Scripts/Dev/GameConstants.cs | 7 + Assets/Scripts/Dev/GameConstants.cs.meta | 11 + Assets/Scripts/Dev/PlayFab.meta | 8 + .../Scripts/Dev/{ => PlayFab}/PlayFabInit.cs | 4 +- .../Dev/{ => PlayFab}/PlayFabInit.cs.meta | 0 .../Dev/PlayFab/PlayFabLeaderboards.cs | 61 ++ .../Dev/PlayFab/PlayFabLeaderboards.cs.meta | 11 + Assets/Scripts/Dev/PlayFab/PlayFabManager.cs | 26 + .../Dev/PlayFab/PlayFabManager.cs.meta | 11 + Assets/Scripts/GamePlayManager.cs | 1 + 13 files changed, 520 insertions(+), 383 deletions(-) create mode 100644 Assets/Scripts/Dev/GameConstants.cs create mode 100644 Assets/Scripts/Dev/GameConstants.cs.meta create mode 100644 Assets/Scripts/Dev/PlayFab.meta rename Assets/Scripts/Dev/{ => PlayFab}/PlayFabInit.cs (90%) rename Assets/Scripts/Dev/{ => PlayFab}/PlayFabInit.cs.meta (100%) create mode 100644 Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs create mode 100644 Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs.meta create mode 100644 Assets/Scripts/Dev/PlayFab/PlayFabManager.cs create mode 100644 Assets/Scripts/Dev/PlayFab/PlayFabManager.cs.meta diff --git a/Assets/PipeOut/Scenes/HomeScene.unity b/Assets/PipeOut/Scenes/HomeScene.unity index 360cbe54..ddd311c8 100644 --- a/Assets/PipeOut/Scenes/HomeScene.unity +++ b/Assets/PipeOut/Scenes/HomeScene.unity @@ -1346,6 +1346,46 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 212661816} m_CullTransparentMesh: 1 +--- !u!21 &230023571 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!21 &238079569 Material: serializedVersion: 8 @@ -1863,46 +1903,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1790415148045805001} m_CullTransparentMesh: 1 ---- !u!21 &264845688 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] --- !u!224 &280846274 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 4603273322937165292, guid: 3fe1e610ab27a064392b55794734a610, @@ -2748,46 +2748,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 321544146} m_CullTransparentMesh: 1 ---- !u!21 &326256327 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] --- !u!222 &331461620 CanvasRenderer: m_ObjectHideFlags: 0 @@ -4514,6 +4474,46 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 437447388} m_CullTransparentMesh: 1 +--- !u!21 &446310310 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!114 &455279778 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4984,46 +4984,6 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 ---- !u!21 &570710048 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] --- !u!114 &574386839 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5132,6 +5092,46 @@ MonoBehaviour: m_EffectColor: {r: 0, g: 0, b: 0, a: 1} m_EffectDistance: {x: 1, y: -2} m_UseGraphicAlpha: 1 +--- !u!21 &594727812 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!1 &635984274 GameObject: m_ObjectHideFlags: 0 @@ -5244,86 +5244,6 @@ RectTransform: m_AnchoredPosition: {x: 56.99, y: -1.6601} m_SizeDelta: {x: 463.43, y: 102} m_Pivot: {x: 0.5, y: 0.5} ---- !u!21 &646859327 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] ---- !u!21 &650888094 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] --- !u!114 &653271491 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5810,27 +5730,14 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 748898821} - - component: {fileID: 748898820} + - component: {fileID: 748898822} m_Layer: 0 - m_Name: PlayFabInitializer + m_Name: PlayFabManager m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &748898820 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 748898819} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 90da569ce88767e4b924f823046b79de, type: 3} - m_Name: - m_EditorClassIdentifier: - playFabTitleId: 7D3B9 --- !u!4 &748898821 Transform: m_ObjectHideFlags: 0 @@ -5846,6 +5753,20 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &748898822 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 748898819} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 030889e21ff6da2419967c5df4aa3fd2, type: 3} + m_Name: + m_EditorClassIdentifier: + playFabInit: {fileID: 0} + playFabLeaderboards: {fileID: 0} --- !u!114 &755857787 MonoBehaviour: m_ObjectHideFlags: 0 @@ -6307,6 +6228,46 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 799869584} m_CullTransparentMesh: 1 +--- !u!21 &801188226 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!1 &820927357 GameObject: m_ObjectHideFlags: 0 @@ -6862,46 +6823,6 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 415970651} m_PrefabAsset: {fileID: 0} ---- !u!21 &971285931 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] --- !u!114 &984614132 MonoBehaviour: m_ObjectHideFlags: 0 @@ -7248,46 +7169,6 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 ---- !u!21 &1045523388 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] --- !u!1 &1045843563 GameObject: m_ObjectHideFlags: 0 @@ -7575,6 +7456,46 @@ MonoBehaviour: optionalRotationMode: 0 optionalScrambleMode: 0 optionalString: +--- !u!21 &1046585980 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!21 &1046856823 Material: serializedVersion: 8 @@ -8874,6 +8795,46 @@ MonoBehaviour: m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} m_EffectDistance: {x: 2, y: 2} m_UseGraphicAlpha: 1 +--- !u!21 &1142329569 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!1001 &1166161366 PrefabInstance: m_ObjectHideFlags: 0 @@ -9030,7 +8991,7 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 1166161366} m_PrefabAsset: {fileID: 0} ---- !u!21 &1181212729 +--- !u!21 &1180254356 Material: serializedVersion: 8 m_ObjectHideFlags: 0 @@ -11538,46 +11499,6 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 ---- !u!21 &1438033904 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] --- !u!1 &1443102696 GameObject: m_ObjectHideFlags: 0 @@ -12398,6 +12319,46 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1790415148045804948} m_CullTransparentMesh: 1 +--- !u!21 &1626533092 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!21 &1656805847 Material: serializedVersion: 8 @@ -13133,6 +13094,46 @@ RectTransform: m_AnchoredPosition: {x: 0.050048828, y: -0.35375977} m_SizeDelta: {x: -1.9000244, y: -3.2799988} m_Pivot: {x: 0.5, y: 0.5} +--- !u!21 &1786459024 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!1 &1821027290 GameObject: m_ObjectHideFlags: 0 @@ -13499,46 +13500,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -20, y: -20} m_Pivot: {x: 0.5, y: 0.5} ---- !u!21 &1899028158 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: 2DxFX/Standard/GrayScale - m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _Alpha: 0 - - _ColorMask: 15 - - _EffectAmount: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] --- !u!1 &1900893649 GameObject: m_ObjectHideFlags: 0 @@ -13749,6 +13710,46 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1902230461} m_CullTransparentMesh: 1 +--- !u!21 &1921808313 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DxFX/Standard/GrayScale + m_Shader: {fileID: 4800000, guid: 62ced1108742e2c4d99c2a6c0708300f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 0 + - _ColorMask: 15 + - _EffectAmount: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] --- !u!1 &1930289644 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset b/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset index 9e9891ad..dc0c4f98 100644 --- a/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset +++ b/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset @@ -12,10 +12,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 093286084a3d1994a9c28281a1c38b1d, type: 3} m_Name: PlayFabSharedSettings m_EditorClassIdentifier: - TitleId: - DeveloperSecretKey: + TitleId: 7D3B9 + DeveloperSecretKey: U4C66QH1S7DKJH1CAEBMICAZ1KJU5E97YZ5BRU6OOREYUE9AJD ProductionEnvironmentUrl: - RequestType: 2 + RequestType: 0 DisableDeviceInfo: 0 DisableFocusTimeCollection: 0 RequestTimeout: 2000 diff --git a/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset.meta b/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset.meta index 9c2c024f..df0d32cd 100644 --- a/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset.meta +++ b/Assets/PlayFabSDK/Shared/Public/Resources/PlayFabSharedSettings.asset.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 guid: 698b2db098268c640929a7b8090a31eb -timeCreated: 1532637394 -licenseType: Pro NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Scripts/Dev/GameConstants.cs b/Assets/Scripts/Dev/GameConstants.cs new file mode 100644 index 00000000..2603a367 --- /dev/null +++ b/Assets/Scripts/Dev/GameConstants.cs @@ -0,0 +1,7 @@ + +public class GameConstants +{ + + public static string LevelCompletedStatsKey = "LevelsCompleted"; + +} diff --git a/Assets/Scripts/Dev/GameConstants.cs.meta b/Assets/Scripts/Dev/GameConstants.cs.meta new file mode 100644 index 00000000..acc4069a --- /dev/null +++ b/Assets/Scripts/Dev/GameConstants.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 662feaf73b5eb5c489c549b4b7d6aa0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Dev/PlayFab.meta b/Assets/Scripts/Dev/PlayFab.meta new file mode 100644 index 00000000..32ac58c1 --- /dev/null +++ b/Assets/Scripts/Dev/PlayFab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db4008a38d1afcf41a74579b973f9272 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Dev/PlayFabInit.cs b/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs similarity index 90% rename from Assets/Scripts/Dev/PlayFabInit.cs rename to Assets/Scripts/Dev/PlayFab/PlayFabInit.cs index 39a8d728..e06814d1 100644 --- a/Assets/Scripts/Dev/PlayFabInit.cs +++ b/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs @@ -6,10 +6,10 @@ using UnityEngine; public class PlayFabInit : MonoBehaviour { - public string playFabTitleId; // Replace with your PlayFab Title ID - + public string playFabTitleId = "7D3B9"; // Replace with your PlayFab Title ID void Start() { + if (string.IsNullOrEmpty(PlayFabSettings.TitleId)) { PlayFabSettings.TitleId = playFabTitleId; diff --git a/Assets/Scripts/Dev/PlayFabInit.cs.meta b/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs.meta similarity index 100% rename from Assets/Scripts/Dev/PlayFabInit.cs.meta rename to Assets/Scripts/Dev/PlayFab/PlayFabInit.cs.meta diff --git a/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs b/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs new file mode 100644 index 00000000..79aa56d7 --- /dev/null +++ b/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic; +using PlayFab; +using PlayFab.ClientModels; +using UnityEngine; + +public class PlayFabLeaderboards : MonoBehaviour +{ + public void UpdateLevelsCompleted(int levelsCompleted) + { + var request = new UpdatePlayerStatisticsRequest + { + Statistics = new List + { + new StatisticUpdate + { + StatisticName = GameConstants.LevelCompletedStatsKey, + Value = levelsCompleted + } + } + }; + PlayFabClientAPI.UpdatePlayerStatistics(request, OnStatisticsUpdateSuccess, OnStatisticsUpdateFailure); + } + + private void OnStatisticsUpdateSuccess(UpdatePlayerStatisticsResult result) + { + Debug.Log("Successfully updated player statistics!"); + } + + private void OnStatisticsUpdateFailure(PlayFabError error) + { + Debug.LogError("Failed to update player statistics: " + error.GenerateErrorReport()); + } + + [ContextMenu("GetLeaderboards")] + public void GetLeaderboard() + { + var request = new GetLeaderboardRequest + { + StatisticName = GameConstants.LevelCompletedStatsKey, + StartPosition = 0, // Start at the top of the leaderboard + MaxResultsCount = 10 // Get top 10 players + }; + + PlayFabClientAPI.GetLeaderboard(request, OnGetLeaderboardSuccess, OnGetLeaderboardFailure); + } + + private void OnGetLeaderboardSuccess(GetLeaderboardResult result) + { + foreach (var entry in result.Leaderboard) + { + Debug.Log($"Player: {entry.PlayFabId}, Position: {entry.Position}, Levels Completed: {entry.StatValue}"); + // You can display this data in your game UI + } + } + + private void OnGetLeaderboardFailure(PlayFabError error) + { + Debug.LogError("Failed to get leaderboard: " + error.GenerateErrorReport()); + } + +} \ No newline at end of file diff --git a/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs.meta b/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs.meta new file mode 100644 index 00000000..1a5d5606 --- /dev/null +++ b/Assets/Scripts/Dev/PlayFab/PlayFabLeaderboards.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4bc7571c5c74ec64bbf41fa0372397c0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Dev/PlayFab/PlayFabManager.cs b/Assets/Scripts/Dev/PlayFab/PlayFabManager.cs new file mode 100644 index 00000000..0d851549 --- /dev/null +++ b/Assets/Scripts/Dev/PlayFab/PlayFabManager.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayFabManager : MonoBehaviour +{ + public static PlayFabManager Instance { get; private set; } + public PlayFabInit playFabInit; + public PlayFabLeaderboards playFabLeaderboards; + private void Awake() + { + if (Instance != null && Instance != this) + { + Destroy(this); + } + else + { + Instance = this; + DontDestroyOnLoad(gameObject); + } + + playFabInit = gameObject.AddComponent(); + playFabLeaderboards = gameObject.AddComponent(); + } + +} diff --git a/Assets/Scripts/Dev/PlayFab/PlayFabManager.cs.meta b/Assets/Scripts/Dev/PlayFab/PlayFabManager.cs.meta new file mode 100644 index 00000000..92f4b3f8 --- /dev/null +++ b/Assets/Scripts/Dev/PlayFab/PlayFabManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 030889e21ff6da2419967c5df4aa3fd2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GamePlayManager.cs b/Assets/Scripts/GamePlayManager.cs index 6d828866..c1c98821 100644 --- a/Assets/Scripts/GamePlayManager.cs +++ b/Assets/Scripts/GamePlayManager.cs @@ -421,6 +421,7 @@ public class GamePlayManager : MonoBehaviour private IEnumerator ShowingGameOver(float delay) { + PlayFabManager.Instance.playFabLeaderboards.UpdateLevelsCompleted(GameManager.CurrentLevelNo); MessagePopup.instance.HideAll(); yield return new WaitForSeconds(delay); LevelCompleteText.text = "Level " + GameManager.CurrentLevelNo + " Completed!";