This commit is contained in:
Sewmina Dilshan 2023-03-21 21:19:40 +05:30
parent 4ac511d260
commit 3db7622e7b
15 changed files with 2047 additions and 26 deletions

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a187246822bbb47529482707f3e0eff8, type: 3}
m_Name: GoogleMobileAdsSettings
m_EditorClassIdentifier:
adMobAndroidAppId: ca-app-pub-3940256099942544~3347511713
adMobAndroidAppId: ca-app-pub-3966734202864173~2020769855
adMobIOSAppId: ca-app-pub-3940256099942544~3347511713
delayAppMeasurementInit: 0
optimizeInitialization: 0

View File

@ -2,6 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.unity.ads" android:versionName="1.0" android:versionCode="1">
<application>
<uses-library android:required="false" android:name="org.apache.http.legacy" />
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713" />
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3966734202864173~2020769855" />
</application>
</manifest>

File diff suppressed because it is too large Load Diff

View File

@ -9676,6 +9676,90 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1642388779
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1642388781}
- component: {fileID: 1642388780}
m_Layer: 0
m_Name: PickupCoin
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!212 &1642388780
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1642388779}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: -2413806693520163455, guid: a86470a33a6bf42c4b3595704624658b, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!4 &1642388781
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1642388779}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.35, z: 0}
m_LocalScale: {x: 2, y: 2, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1659871495
GameObject:
m_ObjectHideFlags: 0

View File

@ -14,8 +14,8 @@ public class AdsManager : MonoBehaviour
instance = this;
}
const string intAdId = "ca-app-pub-3940256099942544/1033173712";
const string rewardedAdId = "ca-app-pub-3940256099942544/5224354917";
const string intAdId = "ca-app-pub-3966734202864173/1197808629";
const string rewardedAdId = "ca-app-pub-3966734202864173/3725853326";
void Start()
{
DontDestroyOnLoad(gameObject);

View File

@ -9,7 +9,7 @@ using UnityEngine.Networking;
public static class DataManager{
public const string API_ENDPOINT = "http://vps.playpoolstudios.com/faucet/golf/api/";
private const string key = "#2CuV1Bit^S!sW1ZcgRv8BhrO";
public const string key = "#2CuV1Bit^S!sW1ZcgRv8BhrO";
public static UserData userData{get; private set;}
public static List<LeaderboardItemData> Leaderboard{get; private set;}
public static bool isLogged{ get{return userData != null;}}
@ -70,6 +70,34 @@ public static class DataManager{
}
public static async Task<int> LinkFH(string fhid){
WWWForm form = new WWWForm();
form.AddField("username", userData.username);
form.AddField("fhid", fhid);
form.AddField("key", key);
using (UnityWebRequest request = UnityWebRequest.Post(API_ENDPOINT + "link_fh.php", form))
{
var operation = request.SendWebRequest();
while (!operation.isDone)
{
await Task.Yield();
}
Debug.Log("fh link response: " +request.downloadHandler.text);
if(request.downloadHandler.text== "0"){
userData.faucetId = int.Parse(fhid);
Debug.Log("FH Link success");
}
}
return 0;
}
public static async void GoogleLogin(string username){
WWWForm form = new WWWForm();
form.AddField("username", username);
@ -211,6 +239,7 @@ public class UserData{
public string password;
public int score;
public int TopScore;
public int faucetId;
public override string ToString()

View File

@ -10,6 +10,9 @@ public class MainMenu : MonoBehaviour
public GameObject MainMenuPanel;
public GameObject SettingsPanel;
public GameObject LeaderboarPanel;
public GameObject LinkAccountPanel;
public InputField fhid_input;
public Button btnLink;
public Transform LeaderboardItemsParent;
public float transitionTime;
public LeanTweenType transitionEffect;
@ -37,6 +40,8 @@ public class MainMenu : MonoBehaviour
copyBtn.onClick.AddListener(CopyId);
signoutBtn.onClick.AddListener(SignOut);
btnLink.onClick.AddListener(OnLinkClicked);
DataManager.RefreshLeaderboard();
}
public void Leave(){
@ -75,6 +80,38 @@ public class MainMenu : MonoBehaviour
LeanTween.moveX(LeaderboarPanel, 10000, transitionTime).setEase(transitionEffect);
}
public void OpenLinkPanel(){
if(DataManager.userData.faucetId > 0){
MessageBox.ShowMessage("You've already linked this player account to Faucet Hub.", "Already Linked");
return;
}
LinkAccountPanel.transform.localScale = Vector3.zero;
LinkAccountPanel.SetActive(true);
LeanTween.scale(LinkAccountPanel, Vector3.one, transitionTime/2f).setEase(LeanTweenType.easeInCirc);
}
public async void OnLinkClicked(){
btnLink.interactable=false;
if(fhid_input.text.Length <= 0){
Debug.Log("Empty FHID was entered");
MessageBox.ShowMessage("Please enter a valid faucet hub ID","Invalid FH ID");
return;
}
int result = await DataManager.LinkFH(fhid_input.text);
if(result == 0){
MessageBox.ShowMessage("Congrats! You've successfully linked this player account with Faucet Hub. Enjoy!", "Success");
LinkAccountPanel.SetActive(false);
}else{
MessageBox.ShowMessage("Something went wrong trying to link this play account to FH ID of " + fhid_input.text, "Link failed");
}
btnLink.interactable=true;
}
public void CopyId(){
GUIUtility.systemCopyBuffer = txtUserId.text;
copyBtn.transform.Find("lbl").GetComponent<Text>().text = "Copied";

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -0,0 +1,147 @@
fileFormatVersion: 2
guid: 3440f07e682e1fa4da7c654d9629d406
TextureImporter:
internalIDToNameTable: []
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 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: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 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
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
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
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
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -113,6 +113,18 @@ TextureImporter:
overridden: 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
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []

BIN
Assets/Sprites/ico_id.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,147 @@
fileFormatVersion: 2
guid: 7be842dec7bf26e47ba5e1b49185b90b
TextureImporter:
internalIDToNameTable: []
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 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: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 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
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
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
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
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.2
bundleVersion: 1.3
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
@ -162,7 +162,7 @@ PlayerSettings:
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 1
AndroidBundleVersionCode: 2
AndroidBundleVersionCode: 3
AndroidMinSdkVersion: 22
AndroidTargetSdkVersion: 33
AndroidPreferredInstallLocation: 1