added UI dodging nozzle on phones
This commit is contained in:
8
Assets/CrystalFramework.meta
Normal file
8
Assets/CrystalFramework.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e8572b3145bb59e4fbe17b91176d1013
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/CrystalFramework/Utility.meta
Normal file
8
Assets/CrystalFramework/Utility.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b45c7b45c9256a745978ed0eb3cf5663
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
233
Assets/CrystalFramework/Utility/SafeArea.cs
Normal file
233
Assets/CrystalFramework/Utility/SafeArea.cs
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Crystal
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Safe area implementation for notched mobile devices. Usage:
|
||||||
|
/// (1) Add this component to the top level of any GUI panel.
|
||||||
|
/// (2) If the panel uses a full screen background image, then create an immediate child and put the component on that instead, with all other elements childed below it.
|
||||||
|
/// This will allow the background image to stretch to the full extents of the screen behind the notch, which looks nicer.
|
||||||
|
/// (3) For other cases that use a mixture of full horizontal and vertical background stripes, use the Conform X & Y controls on separate elements as needed.
|
||||||
|
/// </summary>
|
||||||
|
public class SafeArea : MonoBehaviour
|
||||||
|
{
|
||||||
|
#region Simulations
|
||||||
|
/// <summary>
|
||||||
|
/// Simulation device that uses safe area due to a physical notch or software home bar. For use in Editor only.
|
||||||
|
/// </summary>
|
||||||
|
public enum SimDevice
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Don't use a simulated safe area - GUI will be full screen as normal.
|
||||||
|
/// </summary>
|
||||||
|
None,
|
||||||
|
/// <summary>
|
||||||
|
/// Simulate the iPhone X and Xs (identical safe areas).
|
||||||
|
/// </summary>
|
||||||
|
iPhoneX,
|
||||||
|
/// <summary>
|
||||||
|
/// Simulate the iPhone Xs Max and XR (identical safe areas).
|
||||||
|
/// </summary>
|
||||||
|
iPhoneXsMax,
|
||||||
|
/// <summary>
|
||||||
|
/// Simulate the Google Pixel 3 XL using landscape left.
|
||||||
|
/// </summary>
|
||||||
|
Pixel3XL_LSL,
|
||||||
|
/// <summary>
|
||||||
|
/// Simulate the Google Pixel 3 XL using landscape right.
|
||||||
|
/// </summary>
|
||||||
|
Pixel3XL_LSR
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Simulation mode for use in editor only. This can be edited at runtime to toggle between different safe areas.
|
||||||
|
/// </summary>
|
||||||
|
public static SimDevice Sim = SimDevice.None;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Normalised safe areas for iPhone X with Home indicator (ratios are identical to Xs, 11 Pro). Absolute values:
|
||||||
|
/// PortraitU x=0, y=102, w=1125, h=2202 on full extents w=1125, h=2436;
|
||||||
|
/// PortraitD x=0, y=102, w=1125, h=2202 on full extents w=1125, h=2436 (not supported, remains in Portrait Up);
|
||||||
|
/// LandscapeL x=132, y=63, w=2172, h=1062 on full extents w=2436, h=1125;
|
||||||
|
/// LandscapeR x=132, y=63, w=2172, h=1062 on full extents w=2436, h=1125.
|
||||||
|
/// Aspect Ratio: ~19.5:9.
|
||||||
|
/// </summary>
|
||||||
|
Rect[] NSA_iPhoneX = new Rect[]
|
||||||
|
{
|
||||||
|
new Rect (0f, 102f / 2436f, 1f, 2202f / 2436f), // Portrait
|
||||||
|
new Rect (132f / 2436f, 63f / 1125f, 2172f / 2436f, 1062f / 1125f) // Landscape
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Normalised safe areas for iPhone Xs Max with Home indicator (ratios are identical to XR, 11, 11 Pro Max). Absolute values:
|
||||||
|
/// PortraitU x=0, y=102, w=1242, h=2454 on full extents w=1242, h=2688;
|
||||||
|
/// PortraitD x=0, y=102, w=1242, h=2454 on full extents w=1242, h=2688 (not supported, remains in Portrait Up);
|
||||||
|
/// LandscapeL x=132, y=63, w=2424, h=1179 on full extents w=2688, h=1242;
|
||||||
|
/// LandscapeR x=132, y=63, w=2424, h=1179 on full extents w=2688, h=1242.
|
||||||
|
/// Aspect Ratio: ~19.5:9.
|
||||||
|
/// </summary>
|
||||||
|
Rect[] NSA_iPhoneXsMax = new Rect[]
|
||||||
|
{
|
||||||
|
new Rect (0f, 102f / 2688f, 1f, 2454f / 2688f), // Portrait
|
||||||
|
new Rect (132f / 2688f, 63f / 1242f, 2424f / 2688f, 1179f / 1242f) // Landscape
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Normalised safe areas for Pixel 3 XL using landscape left. Absolute values:
|
||||||
|
/// PortraitU x=0, y=0, w=1440, h=2789 on full extents w=1440, h=2960;
|
||||||
|
/// PortraitD x=0, y=0, w=1440, h=2789 on full extents w=1440, h=2960;
|
||||||
|
/// LandscapeL x=171, y=0, w=2789, h=1440 on full extents w=2960, h=1440;
|
||||||
|
/// LandscapeR x=0, y=0, w=2789, h=1440 on full extents w=2960, h=1440.
|
||||||
|
/// Aspect Ratio: 18.5:9.
|
||||||
|
/// </summary>
|
||||||
|
Rect[] NSA_Pixel3XL_LSL = new Rect[]
|
||||||
|
{
|
||||||
|
new Rect (0f, 0f, 1f, 2789f / 2960f), // Portrait
|
||||||
|
new Rect (0f, 0f, 2789f / 2960f, 1f) // Landscape
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Normalised safe areas for Pixel 3 XL using landscape right. Absolute values and aspect ratio same as above.
|
||||||
|
/// </summary>
|
||||||
|
Rect[] NSA_Pixel3XL_LSR = new Rect[]
|
||||||
|
{
|
||||||
|
new Rect (0f, 0f, 1f, 2789f / 2960f), // Portrait
|
||||||
|
new Rect (171f / 2960f, 0f, 2789f / 2960f, 1f) // Landscape
|
||||||
|
};
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
RectTransform Panel;
|
||||||
|
Rect LastSafeArea = new Rect (0, 0, 0, 0);
|
||||||
|
Vector2Int LastScreenSize = new Vector2Int (0, 0);
|
||||||
|
ScreenOrientation LastOrientation = ScreenOrientation.AutoRotation;
|
||||||
|
[SerializeField] bool ConformX = true; // Conform to screen safe area on X-axis (default true, disable to ignore)
|
||||||
|
[SerializeField] bool ConformY = true; // Conform to screen safe area on Y-axis (default true, disable to ignore)
|
||||||
|
[SerializeField] bool Logging = false; // Conform to screen safe area on Y-axis (default true, disable to ignore)
|
||||||
|
|
||||||
|
void Awake ()
|
||||||
|
{
|
||||||
|
Panel = GetComponent<RectTransform> ();
|
||||||
|
|
||||||
|
if (Panel == null)
|
||||||
|
{
|
||||||
|
Debug.LogError ("Cannot apply safe area - no RectTransform found on " + name);
|
||||||
|
Destroy (gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
Refresh ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update ()
|
||||||
|
{
|
||||||
|
Refresh ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Refresh ()
|
||||||
|
{
|
||||||
|
Rect safeArea = GetSafeArea ();
|
||||||
|
|
||||||
|
if (safeArea != LastSafeArea
|
||||||
|
|| Screen.width != LastScreenSize.x
|
||||||
|
|| Screen.height != LastScreenSize.y
|
||||||
|
|| Screen.orientation != LastOrientation)
|
||||||
|
{
|
||||||
|
// Fix for having auto-rotate off and manually forcing a screen orientation.
|
||||||
|
// See https://forum.unity.com/threads/569236/#post-4473253 and https://forum.unity.com/threads/569236/page-2#post-5166467
|
||||||
|
LastScreenSize.x = Screen.width;
|
||||||
|
LastScreenSize.y = Screen.height;
|
||||||
|
LastOrientation = Screen.orientation;
|
||||||
|
|
||||||
|
ApplySafeArea (safeArea);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rect GetSafeArea ()
|
||||||
|
{
|
||||||
|
Rect safeArea = Screen.safeArea;
|
||||||
|
|
||||||
|
if (Application.isEditor && Sim != SimDevice.None)
|
||||||
|
{
|
||||||
|
Rect nsa = new Rect (0, 0, Screen.width, Screen.height);
|
||||||
|
|
||||||
|
switch (Sim)
|
||||||
|
{
|
||||||
|
case SimDevice.iPhoneX:
|
||||||
|
if (Screen.height > Screen.width) // Portrait
|
||||||
|
nsa = NSA_iPhoneX[0];
|
||||||
|
else // Landscape
|
||||||
|
nsa = NSA_iPhoneX[1];
|
||||||
|
break;
|
||||||
|
case SimDevice.iPhoneXsMax:
|
||||||
|
if (Screen.height > Screen.width) // Portrait
|
||||||
|
nsa = NSA_iPhoneXsMax[0];
|
||||||
|
else // Landscape
|
||||||
|
nsa = NSA_iPhoneXsMax[1];
|
||||||
|
break;
|
||||||
|
case SimDevice.Pixel3XL_LSL:
|
||||||
|
if (Screen.height > Screen.width) // Portrait
|
||||||
|
nsa = NSA_Pixel3XL_LSL[0];
|
||||||
|
else // Landscape
|
||||||
|
nsa = NSA_Pixel3XL_LSL[1];
|
||||||
|
break;
|
||||||
|
case SimDevice.Pixel3XL_LSR:
|
||||||
|
if (Screen.height > Screen.width) // Portrait
|
||||||
|
nsa = NSA_Pixel3XL_LSR[0];
|
||||||
|
else // Landscape
|
||||||
|
nsa = NSA_Pixel3XL_LSR[1];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
safeArea = new Rect (Screen.width * nsa.x, Screen.height * nsa.y, Screen.width * nsa.width, Screen.height * nsa.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
return safeArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplySafeArea (Rect r)
|
||||||
|
{
|
||||||
|
LastSafeArea = r;
|
||||||
|
|
||||||
|
// Ignore x-axis?
|
||||||
|
if (!ConformX)
|
||||||
|
{
|
||||||
|
r.x = 0;
|
||||||
|
r.width = Screen.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ignore y-axis?
|
||||||
|
if (!ConformY)
|
||||||
|
{
|
||||||
|
r.y = 0;
|
||||||
|
r.height = Screen.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for invalid screen startup state on some Samsung devices (see below)
|
||||||
|
if (Screen.width > 0 && Screen.height > 0)
|
||||||
|
{
|
||||||
|
// Convert safe area rectangle from absolute pixels to normalised anchor coordinates
|
||||||
|
Vector2 anchorMin = r.position;
|
||||||
|
Vector2 anchorMax = r.position + r.size;
|
||||||
|
anchorMin.x /= Screen.width;
|
||||||
|
anchorMin.y /= Screen.height;
|
||||||
|
anchorMax.x /= Screen.width;
|
||||||
|
anchorMax.y /= Screen.height;
|
||||||
|
|
||||||
|
// Fix for some Samsung devices (e.g. Note 10+, A71, S20) where Refresh gets called twice and the first time returns NaN anchor coordinates
|
||||||
|
// See https://forum.unity.com/threads/569236/page-2#post-6199352
|
||||||
|
if (anchorMin.x >= 0 && anchorMin.y >= 0 && anchorMax.x >= 0 && anchorMax.y >= 0)
|
||||||
|
{
|
||||||
|
Panel.anchorMin = anchorMin;
|
||||||
|
Panel.anchorMax = anchorMax;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Logging)
|
||||||
|
{
|
||||||
|
Debug.LogFormat ("New safe area applied to {0}: x={1}, y={2}, w={3}, h={4} on full extents w={5}, h={6}",
|
||||||
|
name, r.x, r.y, r.width, r.height, Screen.width, Screen.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
Assets/CrystalFramework/Utility/SafeArea.cs.meta
Normal file
18
Assets/CrystalFramework/Utility/SafeArea.cs.meta
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c97afc556caea1c44969477eb7ddec74
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 130488
|
||||||
|
packageName: Safe Area Helper
|
||||||
|
packageVersion: 1.0.6
|
||||||
|
assetPath: Assets/CrystalFramework/Utility/SafeArea.cs
|
||||||
|
uploadId: 385285
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
|
using Cysharp.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Darkmatter.Core
|
namespace Darkmatter.Core
|
||||||
{
|
{
|
||||||
public interface ILeaderBoardController
|
public interface ILeaderBoardController
|
||||||
{
|
{
|
||||||
void ShowLeaderBoard();
|
UniTask ShowLeaderBoardAsync();
|
||||||
void UpdateLeaderBoardScore(int score);
|
UniTask UpdateLeaderBoardScore(int score);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
"references": [
|
"references": [
|
||||||
"GUID:4307f53044263cf4b835bd812fc161a4",
|
"GUID:4307f53044263cf4b835bd812fc161a4",
|
||||||
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
|
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
|
||||||
"GUID:75469ad4d38634e559750d17036d5f7c"
|
"GUID:75469ad4d38634e559750d17036d5f7c",
|
||||||
|
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|||||||
8
Assets/DarkMatter/Code/Domain/GenericPool.meta
Normal file
8
Assets/DarkMatter/Code/Domain/GenericPool.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 75a2920ba3d7abc4b94a5b95351e7dac
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
57
Assets/DarkMatter/Code/Domain/GenericPool/ObjectPool.cs
Normal file
57
Assets/DarkMatter/Code/Domain/GenericPool/ObjectPool.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
using Darkmatter.Core;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using VContainer;
|
||||||
|
using VContainer.Unity;
|
||||||
|
|
||||||
|
namespace Darkmatter.Domain
|
||||||
|
{
|
||||||
|
public class ObjectPool<T> : MonoBehaviour,IPool<T> where T : Component
|
||||||
|
{
|
||||||
|
[SerializeField] T prefab;
|
||||||
|
[SerializeField] private Transform prefabParent;
|
||||||
|
[SerializeField] private int poolSize = 15;
|
||||||
|
|
||||||
|
public Queue<T> pool = new Queue<T>();
|
||||||
|
[Inject] IObjectResolver resolver;
|
||||||
|
|
||||||
|
public IReadOnlyCollection<T> All => pool;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
CreateObjectPool();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateObjectPool()
|
||||||
|
{
|
||||||
|
for(int i=0;i<poolSize; i++)
|
||||||
|
{
|
||||||
|
T obj = Instantiate(prefab, prefabParent);
|
||||||
|
resolver.InjectGameObject(obj.gameObject);
|
||||||
|
obj.gameObject.SetActive(false);
|
||||||
|
pool.Enqueue(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetFromPool()
|
||||||
|
{
|
||||||
|
if(pool.Count == 0)
|
||||||
|
{
|
||||||
|
T obj = Instantiate(prefab, prefabParent);
|
||||||
|
resolver.InjectGameObject(obj.gameObject);
|
||||||
|
obj.gameObject.SetActive(true);
|
||||||
|
pool.Enqueue(obj);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
T returningObj = pool.Dequeue();
|
||||||
|
returningObj.gameObject.SetActive(true);
|
||||||
|
return returningObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReturnToPool(T obj)
|
||||||
|
{
|
||||||
|
obj.gameObject.SetActive(false);
|
||||||
|
pool.Enqueue(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e060b99c1df2bec40871a980f4b6c339
|
||||||
@@ -2,6 +2,7 @@ using Unity.Services.Core;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Unity.Services.Authentication;
|
using Unity.Services.Authentication;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Cysharp.Threading.Tasks;
|
||||||
|
|
||||||
|
|
||||||
namespace Darkmatter.Presentation
|
namespace Darkmatter.Presentation
|
||||||
@@ -13,7 +14,7 @@ namespace Darkmatter.Presentation
|
|||||||
await Init();
|
await Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Init()
|
private async UniTask Init()
|
||||||
{
|
{
|
||||||
await UnityServices.InitializeAsync();
|
await UnityServices.InitializeAsync();
|
||||||
if (!AuthenticationService.Instance.IsSignedIn)
|
if (!AuthenticationService.Instance.IsSignedIn)
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ public class Platform : MonoBehaviour, IPlatform
|
|||||||
if(other.CompareTag("Player") && !hasAchievedScore)
|
if(other.CompareTag("Player") && !hasAchievedScore)
|
||||||
{
|
{
|
||||||
hasAchievedScore = true;
|
hasAchievedScore = true;
|
||||||
Debug.Log("Score Increased");
|
|
||||||
IscoreService.AddScore();
|
IscoreService.AddScore();
|
||||||
IaudioController.PlayScoredSound();
|
IaudioController.PlayScoredSound();
|
||||||
_particleSystem.Play();
|
_particleSystem.Play();
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
"GUID:4307f53044263cf4b835bd812fc161a4",
|
"GUID:4307f53044263cf4b835bd812fc161a4",
|
||||||
"GUID:5540e30183c82e84b954c033c388e06c",
|
"GUID:5540e30183c82e84b954c033c388e06c",
|
||||||
"GUID:2073209246492244c9ad62c89d8d37bb",
|
"GUID:2073209246492244c9ad62c89d8d37bb",
|
||||||
"GUID:fe25561d224ed4743af4c60938a59d0b"
|
"GUID:fe25561d224ed4743af4c60938a59d0b",
|
||||||
|
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Darkmatter.Presentation
|
|||||||
private void OnLeaderBoardBtnClicked()
|
private void OnLeaderBoardBtnClicked()
|
||||||
{
|
{
|
||||||
IaudioController.PlayBtnPressedSound();
|
IaudioController.PlayBtnPressedSound();
|
||||||
IleaderBoardController.ShowLeaderBoard();
|
IleaderBoardController.ShowLeaderBoardAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowDeathScreen()
|
public void ShowDeathScreen()
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ namespace Darkmatter.Presentation
|
|||||||
|
|
||||||
private void UpdateScore(int score)
|
private void UpdateScore(int score)
|
||||||
{
|
{
|
||||||
Debug.Log("calling Score");
|
|
||||||
gameScreenView.UpdateScore(score);
|
gameScreenView.UpdateScore(score);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
using Cysharp.Threading.Tasks;
|
||||||
using Darkmatter.Core;
|
using Darkmatter.Core;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Unity.Services.Leaderboards;
|
using Unity.Services.Leaderboards;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VContainer;
|
using VContainer;
|
||||||
@@ -33,13 +35,16 @@ namespace Darkmatter.Presentation
|
|||||||
leaderBoardView.Hide();
|
leaderBoardView.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowLeaderBoard()
|
public async UniTask ShowLeaderBoardAsync()
|
||||||
{
|
{
|
||||||
LoadLeaderBoard();
|
|
||||||
leaderBoardView.Show();
|
leaderBoardView.Show();
|
||||||
|
leaderBoardView.ShowLoading(true);
|
||||||
|
await LoadLeaderBoard();
|
||||||
|
leaderBoardView.ShowLoading(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async void LoadLeaderBoard()
|
async UniTask LoadLeaderBoard()
|
||||||
{
|
{
|
||||||
var score = await LeaderboardsService.Instance.GetScoresAsync(leaderBoardID, new GetScoresOptions { Limit = 10 });
|
var score = await LeaderboardsService.Instance.GetScoresAsync(leaderBoardID, new GetScoresOptions { Limit = 10 });
|
||||||
int rank = 1;
|
int rank = 1;
|
||||||
@@ -63,7 +68,7 @@ namespace Darkmatter.Presentation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void UpdateLeaderBoardScore(int score)
|
public async UniTask UpdateLeaderBoardScore(int score)
|
||||||
{
|
{
|
||||||
await LeaderboardsService.Instance.AddPlayerScoreAsync(leaderBoardID, score);
|
await LeaderboardsService.Instance.AddPlayerScoreAsync(leaderBoardID, score);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace Darkmatter.Presentation
|
|||||||
public GameObject leaderBoardScreen;
|
public GameObject leaderBoardScreen;
|
||||||
public Button ExitButton;
|
public Button ExitButton;
|
||||||
public LeaderBoardData LBplayerData;
|
public LeaderBoardData LBplayerData;
|
||||||
|
public TextMeshProUGUI loadingText;
|
||||||
|
|
||||||
public void Show()
|
public void Show()
|
||||||
{
|
{
|
||||||
@@ -20,5 +21,10 @@ namespace Darkmatter.Presentation
|
|||||||
{
|
{
|
||||||
leaderBoardScreen.SetActive(false);
|
leaderBoardScreen.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ShowLoading(bool shouldShow)
|
||||||
|
{
|
||||||
|
loadingText.gameObject.SetActive(shouldShow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ namespace Darkmatter.Presentation
|
|||||||
[Inject] private IGameSession IgameSession;
|
[Inject] private IGameSession IgameSession;
|
||||||
public StartScreenController(StartScreenView _startScreenView, IGameScreenController _gameScreenController)
|
public StartScreenController(StartScreenView _startScreenView, IGameScreenController _gameScreenController)
|
||||||
{
|
{
|
||||||
Debug.Log("StartScreenController Constructor Called");
|
|
||||||
startScreenView = _startScreenView;
|
startScreenView = _startScreenView;
|
||||||
gameScreenController = _gameScreenController;
|
gameScreenController = _gameScreenController;
|
||||||
startScreenView.tapToStartButton.onClick.AddListener(OnTapToStartButtonClicked);
|
startScreenView.tapToStartButton.onClick.AddListener(OnTapToStartButtonClicked);
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ Material:
|
|||||||
- _XRMotionVectorsPass: 1
|
- _XRMotionVectorsPass: 1
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- _BaseColor: {r: 0.22148229, g: 0.13866144, b: 0.7169812, a: 0}
|
- _BaseColor: {r: 0.735849, g: 0.09371662, b: 0.48520926, a: 0}
|
||||||
- _Color: {r: 0.22148225, g: 0.13866141, b: 0.7169812, a: 0}
|
- _Color: {r: 0.735849, g: 0.093716584, b: 0.48520917, a: 0}
|
||||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||||
m_BuildTextureStacks: []
|
m_BuildTextureStacks: []
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ Material:
|
|||||||
- _XRMotionVectorsPass: 1
|
- _XRMotionVectorsPass: 1
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- _BaseColor: {r: 0.17342028, g: 0.754717, b: 0.0747597, a: 0}
|
- _BaseColor: {r: 0.8679245, g: 0.8474546, b: 0.8474546, a: 0}
|
||||||
- _Color: {r: 0.8113207, g: 0.049750805, b: 0.049750805, a: 0}
|
- _Color: {r: 0.8113207, g: 0.049750805, b: 0.049750805, a: 0}
|
||||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ Material:
|
|||||||
- _XRMotionVectorsPass: 1
|
- _XRMotionVectorsPass: 1
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- _BaseColor: {r: 0.7924528, g: 0.7552929, b: 0.063545756, a: 1}
|
- _BaseColor: {r: 0.122641504, g: 0.12090601, b: 0.12090601, a: 0}
|
||||||
- _Color: {r: 0.12264148, g: 0.12090597, b: 0.12090597, a: 0}
|
- _Color: {r: 0.12264148, g: 0.12090597, b: 0.12090597, a: 0}
|
||||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||||
|
|||||||
@@ -11279,7 +11279,7 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 74, y: 119.00012}
|
m_AnchoredPosition: {x: 74, y: 119}
|
||||||
m_SizeDelta: {x: 120, y: 120}
|
m_SizeDelta: {x: 120, y: 120}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &501358099
|
--- !u!114 &501358099
|
||||||
@@ -12604,6 +12604,7 @@ GameObject:
|
|||||||
- component: {fileID: 861211734}
|
- component: {fileID: 861211734}
|
||||||
- component: {fileID: 861211733}
|
- component: {fileID: 861211733}
|
||||||
- component: {fileID: 861211737}
|
- component: {fileID: 861211737}
|
||||||
|
- component: {fileID: 861211738}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: Screens
|
m_Name: Screens
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -12711,7 +12712,160 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier: PresentationAssembly::Darkmatter.Presentation.LeaderBoardView
|
m_EditorClassIdentifier: PresentationAssembly::Darkmatter.Presentation.LeaderBoardView
|
||||||
leaderBoardScreen: {fileID: 155034150}
|
leaderBoardScreen: {fileID: 155034150}
|
||||||
ExitButton: {fileID: 501358099}
|
ExitButton: {fileID: 501358099}
|
||||||
LBplayerData: {fileID: 0}
|
LBplayerData: {fileID: 1566650972078747329, guid: b16e394676a0f3e4dbf81cd523bf2325, type: 3}
|
||||||
|
loadingText: {fileID: 894586376}
|
||||||
|
--- !u!114 &861211738
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 861211731}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: c97afc556caea1c44969477eb7ddec74, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::Crystal.SafeArea
|
||||||
|
ConformX: 1
|
||||||
|
ConformY: 1
|
||||||
|
Logging: 0
|
||||||
|
--- !u!1 &894586374
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 894586375}
|
||||||
|
- component: {fileID: 894586377}
|
||||||
|
- component: {fileID: 894586376}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: LoadingText
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &894586375
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 894586374}
|
||||||
|
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: 1926046908}
|
||||||
|
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: 252.1415, y: 63.035}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &894586376
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 894586374}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
|
||||||
|
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: Loading...
|
||||||
|
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: 56.4
|
||||||
|
m_fontSizeBase: 36
|
||||||
|
m_fontWeight: 400
|
||||||
|
m_enableAutoSizing: 1
|
||||||
|
m_fontSizeMin: 18
|
||||||
|
m_fontSizeMax: 72
|
||||||
|
m_fontStyle: 0
|
||||||
|
m_HorizontalAlignment: 2
|
||||||
|
m_VerticalAlignment: 512
|
||||||
|
m_textAlignment: 65535
|
||||||
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
|
m_wordSpacing: 0
|
||||||
|
m_lineSpacing: 0
|
||||||
|
m_lineSpacingMax: 0
|
||||||
|
m_paragraphSpacing: 0
|
||||||
|
m_charWidthMaxAdj: 0
|
||||||
|
m_TextWrappingMode: 1
|
||||||
|
m_wordWrappingRatios: 0.4
|
||||||
|
m_overflowMode: 0
|
||||||
|
m_linkedTextComponent: {fileID: 0}
|
||||||
|
parentLinkedComponent: {fileID: 0}
|
||||||
|
m_enableKerning: 0
|
||||||
|
m_ActiveFontFeatures: 6e72656b
|
||||||
|
m_enableExtraPadding: 0
|
||||||
|
checkPaddingRequired: 0
|
||||||
|
m_isRichText: 1
|
||||||
|
m_EmojiFallbackSupport: 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 &894586377
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 894586374}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
--- !u!1 &926831878
|
--- !u!1 &926831878
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -14528,7 +14682,7 @@ GameObject:
|
|||||||
- component: {fileID: 1741932666}
|
- component: {fileID: 1741932666}
|
||||||
- component: {fileID: 1741932667}
|
- component: {fileID: 1741932667}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: API_Initializers
|
m_Name: LBAPI_Initializers
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
@@ -15207,6 +15361,7 @@ RectTransform:
|
|||||||
- {fileID: 1152032975}
|
- {fileID: 1152032975}
|
||||||
- {fileID: 789049441}
|
- {fileID: 789049441}
|
||||||
- {fileID: 501358098}
|
- {fileID: 501358098}
|
||||||
|
- {fileID: 894586375}
|
||||||
m_Father: {fileID: 155034151}
|
m_Father: {fileID: 155034151}
|
||||||
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}
|
||||||
@@ -15861,9 +16016,9 @@ SceneRoots:
|
|||||||
- {fileID: 832575519}
|
- {fileID: 832575519}
|
||||||
- {fileID: 268692280}
|
- {fileID: 268692280}
|
||||||
- {fileID: 581798940}
|
- {fileID: 581798940}
|
||||||
- {fileID: 343573093}
|
|
||||||
- {fileID: 791472102}
|
- {fileID: 791472102}
|
||||||
- {fileID: 2056622164}
|
- {fileID: 2056622164}
|
||||||
- {fileID: 1783072554}
|
- {fileID: 1783072554}
|
||||||
- {fileID: 1741932666}
|
- {fileID: 1741932666}
|
||||||
- {fileID: 1111723450}
|
- {fileID: 1111723450}
|
||||||
|
- {fileID: 343573093}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask",
|
||||||
"com.unity.ai.navigation": "2.0.9",
|
"com.unity.ai.navigation": "2.0.9",
|
||||||
"com.unity.cinemachine": "3.1.5",
|
"com.unity.cinemachine": "3.1.5",
|
||||||
"com.unity.collab-proxy": "2.10.2",
|
"com.unity.collab-proxy": "2.10.2",
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.cysharp.unitask": {
|
||||||
|
"version": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "git",
|
||||||
|
"dependencies": {},
|
||||||
|
"hash": "73a63b7f672b88f7e9992f6917eb458a8cbb6fa9"
|
||||||
|
},
|
||||||
"com.merry-yellow.code-assist": {
|
"com.merry-yellow.code-assist": {
|
||||||
"version": "file:com.merry-yellow.code-assist",
|
"version": "file:com.merry-yellow.code-assist",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
|||||||
@@ -575,13 +575,16 @@ PlayerSettings:
|
|||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
m_BuildTarget: Android
|
m_BuildTarget: Android
|
||||||
m_Formats: 03000000
|
m_Formats: 03000000
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_BuildTarget: iOS
|
||||||
|
m_Formats: 03000000
|
||||||
playModeTestRunnerEnabled: 0
|
playModeTestRunnerEnabled: 0
|
||||||
runPlayModeTestAsEditModeTest: 0
|
runPlayModeTestAsEditModeTest: 0
|
||||||
actionOnDotNetUnhandledException: 1
|
actionOnDotNetUnhandledException: 1
|
||||||
editorGfxJobOverride: 1
|
editorGfxJobOverride: 1
|
||||||
enableInternalProfiler: 0
|
enableInternalProfiler: 0
|
||||||
logObjCUncaughtExceptions: 1
|
logObjCUncaughtExceptions: 1
|
||||||
enableCrashReportAPI: 0
|
enableCrashReportAPI: 1
|
||||||
cameraUsageDescription:
|
cameraUsageDescription:
|
||||||
locationUsageDescription:
|
locationUsageDescription:
|
||||||
microphoneUsageDescription:
|
microphoneUsageDescription:
|
||||||
|
|||||||
Reference in New Issue
Block a user