Compare commits
2 Commits
f8eed62a9f
...
47880ef652
| Author | SHA1 | Date | |
|---|---|---|---|
| 47880ef652 | |||
| 9af9ac09fb |
BIN
Assets/Artifacts/Sprites/Other/freepik__background__18020.png
Normal file
BIN
Assets/Artifacts/Sprites/Other/freepik__background__18020.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
@ -0,0 +1,147 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 34e3d7c5f315b46f9b3481e3ea797ffe
|
||||||
|
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: 0
|
||||||
|
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: iPhone
|
||||||
|
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
|
||||||
|
- 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
|
||||||
|
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:
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class Dice : MonoBehaviour, IBase, IBootLoader
|
public class DiceView : MonoBehaviour, IBase, IBootLoader
|
||||||
{
|
{
|
||||||
private Rigidbody rb;
|
private Rigidbody rb;
|
||||||
private bool rolling;
|
private bool rolling;
|
||||||
@ -22,7 +22,7 @@ public class Dice : MonoBehaviour, IBase, IBootLoader
|
|||||||
}
|
}
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
InterfaceManager.Instance?.RegisterInterface<Dice>(this);
|
InterfaceManager.Instance?.RegisterInterface<DiceView>(this);
|
||||||
transform.localPosition = new Vector3(0, 20, 0);
|
transform.localPosition = new Vector3(0, 20, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
2128
Assets/Prefabs/UI/Player V AI Popup .prefab
Normal file
2128
Assets/Prefabs/UI/Player V AI Popup .prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: a0f4457742bfd4c61bd436792af64064
|
guid: b04f48863fc6c4f75821857086cea347
|
||||||
PrefabImporter:
|
PrefabImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
4441
Assets/Prefabs/UI/Player V Player Popup.prefab
Normal file
4441
Assets/Prefabs/UI/Player V Player Popup.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Prefabs/UI/Player V Player Popup.prefab.meta
Normal file
7
Assets/Prefabs/UI/Player V Player Popup.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4fd2ca927610f4ed9a93f6bb3ec71a1d
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
15944
Assets/Scenes/Game.unity
15944
Assets/Scenes/Game.unity
File diff suppressed because it is too large
Load Diff
@ -5,4 +5,9 @@ using UnityEngine;
|
|||||||
public static class Ludo_3D_Constants
|
public static class Ludo_3D_Constants
|
||||||
{
|
{
|
||||||
public const int Max_Dice_Rolls = 6;
|
public const int Max_Dice_Rolls = 6;
|
||||||
|
|
||||||
|
public const string Player1_Name = "Player1";
|
||||||
|
public const string Player2_Name = "Player2";
|
||||||
|
public const string Player3_Name = "Player3";
|
||||||
|
public const string Player4_Name = "Player4";
|
||||||
}
|
}
|
||||||
@ -43,6 +43,8 @@ public enum BotMove
|
|||||||
|
|
||||||
public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||||
{
|
{
|
||||||
|
[SerializeField] DiceRollHandler diceRollHandler;
|
||||||
|
|
||||||
[SerializeField] private int diceValue = 0;
|
[SerializeField] private int diceValue = 0;
|
||||||
|
|
||||||
[SerializeField] private TextMeshProUGUI diceText;
|
[SerializeField] private TextMeshProUGUI diceText;
|
||||||
@ -59,8 +61,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
|||||||
private int currentPlayerTurnIndex = 0;
|
private int currentPlayerTurnIndex = 0;
|
||||||
private List<PlayerType> allPlayerTypes = new List<PlayerType>();
|
private List<PlayerType> allPlayerTypes = new List<PlayerType>();
|
||||||
private List<PlayerType> botTypesInGame = new List<PlayerType>();
|
private List<PlayerType> botTypesInGame = new List<PlayerType>();
|
||||||
|
private List<PlayerType> playerRankings = new List<PlayerType>();
|
||||||
|
|
||||||
public List<PlayerType> PlayerTypesCollection => allPlayerTypes;
|
|
||||||
|
|
||||||
// private Dictionary<PlayerTypes, > playerPawnsDict = new Dictionary<PlayerTypes, List<PlayerPawn>>();
|
// private Dictionary<PlayerTypes, > playerPawnsDict = new Dictionary<PlayerTypes, List<PlayerPawn>>();
|
||||||
private Dictionary<PlayerType, PlayerGameData> playerGameDatasDict = new Dictionary<PlayerType, PlayerGameData>();
|
private Dictionary<PlayerType, PlayerGameData> playerGameDatasDict = new Dictionary<PlayerType, PlayerGameData>();
|
||||||
@ -71,13 +73,18 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
|||||||
private TilesManager tilesManager;
|
private TilesManager tilesManager;
|
||||||
|
|
||||||
private int diceRolledValue;
|
private int diceRolledValue;
|
||||||
|
|
||||||
|
private bool CanRollDiceAgain = false; // used for when you get a 6 or when you reach the finish point
|
||||||
|
private int diceSixRollCounter = 0;
|
||||||
|
|
||||||
|
private List<PlayerPawn> availPlayers = new List<PlayerPawn>();
|
||||||
|
private bool canSwitchPlayer = false;
|
||||||
|
|
||||||
public bool CanRollDice
|
public bool CanRollDice
|
||||||
{
|
{
|
||||||
get; private set;
|
get; private set;
|
||||||
}
|
}
|
||||||
|
public List<PlayerType> PlayerTypesCollection => allPlayerTypes;
|
||||||
private bool CanRollDiceAgain = false; // used for when you get a 6 or when you reach the finish point
|
|
||||||
private int diceSixRollCounter = 0;
|
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
@ -223,10 +230,13 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnDiceInteracted()
|
||||||
|
{
|
||||||
|
diceRollHandler.HandleDiceView();
|
||||||
|
}
|
||||||
|
|
||||||
public void RollDiceForPlayer(int rolledVal)
|
public void RollDiceForPlayer(int rolledVal)
|
||||||
{
|
{
|
||||||
if (botTypesInGame.Contains(currentPlayerTypeTurn)) return;
|
|
||||||
|
|
||||||
OnDiceRolled(rolledVal);
|
OnDiceRolled(rolledVal);
|
||||||
OnNoMovesLeft();
|
OnNoMovesLeft();
|
||||||
}
|
}
|
||||||
@ -420,9 +430,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<PlayerPawn> availPlayers = new List<PlayerPawn>();
|
|
||||||
private bool canSwitchPlayer = false;
|
|
||||||
|
|
||||||
public void OnDiceRolled(int rolledVal)
|
public void OnDiceRolled(int rolledVal)
|
||||||
{
|
{
|
||||||
SetCanRollDiceForUser(false);
|
SetCanRollDiceForUser(false);
|
||||||
@ -890,7 +897,21 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
|||||||
CanRollDiceAgain = false;
|
CanRollDiceAgain = false;
|
||||||
|
|
||||||
if (allPlayerTypes.Contains(currentPlayerTypeTurn))
|
if (allPlayerTypes.Contains(currentPlayerTypeTurn))
|
||||||
|
{
|
||||||
|
playerRankings.Add(currentPlayerTypeTurn);
|
||||||
allPlayerTypes.Remove(currentPlayerTypeTurn);
|
allPlayerTypes.Remove(currentPlayerTypeTurn);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allPlayerTypes.Count == 1)
|
||||||
|
{
|
||||||
|
// Game is over
|
||||||
|
playerRankings.Add(allPlayerTypes[0]);
|
||||||
|
allPlayerTypes.Remove(0);
|
||||||
|
|
||||||
|
// Show Game Over panel
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SwitchPlayer();
|
SwitchPlayer();
|
||||||
|
|
||||||
|
|||||||
@ -104,6 +104,7 @@ public class PlayerPawn : MonoBehaviour
|
|||||||
// when he is defeated
|
// when he is defeated
|
||||||
public void MoveBackToHome(Transform transformData)
|
public void MoveBackToHome(Transform transformData)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"MoveBackToHome");
|
||||||
transform.position = transformData.position;
|
transform.position = transformData.position;
|
||||||
transform.rotation = transformData.rotation;
|
transform.rotation = transformData.rotation;
|
||||||
SetPlayerState(PlayerState.InHome);
|
SetPlayerState(PlayerState.InHome);
|
||||||
|
|||||||
@ -2,8 +2,9 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class DiceRoller : MonoBehaviour
|
public class DiceRollHandler : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
[SerializeField] private DiceView diceView;
|
||||||
[SerializeField] private int diceTestValue = 0;
|
[SerializeField] private int diceTestValue = 0;
|
||||||
|
|
||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
@ -13,7 +14,7 @@ public class DiceRoller : MonoBehaviour
|
|||||||
inputManager = inputManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<InputManager>() : inputManager;
|
inputManager = inputManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<InputManager>() : inputManager;
|
||||||
if (!inputManager.GameplayManager.CanRollDice) return;
|
if (!inputManager.GameplayManager.CanRollDice) return;
|
||||||
|
|
||||||
OnDiceRolled();
|
RollDiceOnClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
@ -22,10 +23,10 @@ public class DiceRoller : MonoBehaviour
|
|||||||
if (!inputManager.GameplayManager.CanRollDice) return;
|
if (!inputManager.GameplayManager.CanRollDice) return;
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Space))
|
if (Input.GetKeyDown(KeyCode.Space))
|
||||||
OnDiceRolled();
|
RollDiceOnClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDiceRolled()
|
private void RollDiceOnClick()
|
||||||
{
|
{
|
||||||
SoundManager soundManager = InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>();
|
SoundManager soundManager = InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>();
|
||||||
soundManager?.PlayGameSoundClip(SoundType.Dice);
|
soundManager?.PlayGameSoundClip(SoundType.Dice);
|
||||||
@ -34,4 +35,9 @@ public class DiceRoller : MonoBehaviour
|
|||||||
diceTestValue != 0 ? diceTestValue : Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1);
|
diceTestValue != 0 ? diceTestValue : Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1);
|
||||||
inputManager.SetDiceRollValue(currentRolledVal);
|
inputManager.SetDiceRollValue(currentRolledVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void HandleDiceView()
|
||||||
|
{
|
||||||
|
diceView.Roll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
8
Assets/Scripts/State.meta
Normal file
8
Assets/Scripts/State.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a7e3406fc0f8a4b3abf3913c7655f3f1
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
43
Assets/Scripts/State/GameManager.cs
Normal file
43
Assets/Scripts/State/GameManager.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public enum GameState
|
||||||
|
{
|
||||||
|
InMenu,
|
||||||
|
InGame,
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GameManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||||
|
{
|
||||||
|
private UIManager uiManager;
|
||||||
|
|
||||||
|
public GameState GameState
|
||||||
|
{
|
||||||
|
get; private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Initialize()
|
||||||
|
{
|
||||||
|
InterfaceManager.Instance.RegisterInterface<GameManager>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitializeData()
|
||||||
|
{
|
||||||
|
uiManager = InterfaceManager.Instance.GetInterfaceInstance<UIManager>();
|
||||||
|
|
||||||
|
GameState = GameState.InMenu;
|
||||||
|
OnGameStateChanged(GameState);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnGameStateChanged(GameState gameState)
|
||||||
|
{
|
||||||
|
switch (gameState)
|
||||||
|
{
|
||||||
|
case GameState.InMenu:
|
||||||
|
uiManager.OnInMenuScreen();
|
||||||
|
break;
|
||||||
|
case GameState.InGame:
|
||||||
|
uiManager.OnInGameScreen();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/State/GameManager.cs.meta
Normal file
11
Assets/Scripts/State/GameManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 39da8f399f9774587bd1d0c7977e556b
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -57,6 +57,12 @@ public class ScreenManager : MonoBehaviour, IBase, IBootLoader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void HideAllScreens()
|
||||||
|
{
|
||||||
|
foreach (var screenPair in screensDict)
|
||||||
|
if (screenPair.Value.isActiveAndEnabled) screenPair.Value.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
// public void OnScreenEventExecute(ScreenResultEvent screenResultEvent)
|
// public void OnScreenEventExecute(ScreenResultEvent screenResultEvent)
|
||||||
// {
|
// {
|
||||||
// switch (screenResultEvent)
|
// switch (screenResultEvent)
|
||||||
|
|||||||
45
Assets/Scripts/UI/Managers/UIManager.cs
Normal file
45
Assets/Scripts/UI/Managers/UIManager.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class UIManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||||
|
{
|
||||||
|
private GameplayManager gameplayManager;
|
||||||
|
private PopupManager popupManager;
|
||||||
|
private ScreenManager screenManager;
|
||||||
|
|
||||||
|
public void Initialize()
|
||||||
|
{
|
||||||
|
InterfaceManager.Instance.RegisterInterface<UIManager>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitializeData()
|
||||||
|
{
|
||||||
|
gameplayManager = InterfaceManager.Instance.GetInterfaceInstance<GameplayManager>();
|
||||||
|
popupManager = InterfaceManager.Instance.GetInterfaceInstance<PopupManager>();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDiceViewInteracted()
|
||||||
|
{
|
||||||
|
gameplayManager.OnDiceInteracted();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnInMenuScreen()
|
||||||
|
{
|
||||||
|
screenManager = screenManager == null ? InterfaceManager.Instance.GetInterfaceInstance<ScreenManager>() : screenManager;
|
||||||
|
screenManager.HideAllScreens();
|
||||||
|
screenManager.ShowScreen(ScreenType.MenuScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnInGameScreen()
|
||||||
|
{
|
||||||
|
screenManager.HideAllScreens();
|
||||||
|
screenManager.ShowScreen(ScreenType.InGameHUDScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnPlayButtonClicked()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Managers/UIManager.cs.meta
Normal file
11
Assets/Scripts/UI/Managers/UIManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bebcbb45c745a4006be9ef5b25e12cd5
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -10,8 +10,7 @@ public enum ScreenType
|
|||||||
LoadingScreen,
|
LoadingScreen,
|
||||||
LevelsScreen,
|
LevelsScreen,
|
||||||
InGameHUDScreen,
|
InGameHUDScreen,
|
||||||
MenuHUDScreen,
|
MenuScreen,
|
||||||
GlobalHUDScreen
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ScreenBase : UIBase, IUIBase
|
public class ScreenBase : UIBase, IUIBase
|
||||||
|
|||||||
@ -21,7 +21,7 @@ public class InstructionsPopup : PopupBase
|
|||||||
private void OnClick_closeBtn()
|
private void OnClick_closeBtn()
|
||||||
{
|
{
|
||||||
ScreenManager screenManager = InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>();
|
ScreenManager screenManager = InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>();
|
||||||
screenManager.ShowScreen(ScreenType.MenuHUDScreen);
|
screenManager.ShowScreen(ScreenType.MenuScreen);
|
||||||
|
|
||||||
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
||||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||||
|
|||||||
@ -29,7 +29,7 @@ public class OptionsPopup : PopupBase
|
|||||||
private void OnClick_closeBtn()
|
private void OnClick_closeBtn()
|
||||||
{
|
{
|
||||||
ScreenManager screenManager = InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>();
|
ScreenManager screenManager = InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>();
|
||||||
screenManager.ShowScreen(ScreenType.MenuHUDScreen);
|
screenManager.ShowScreen(ScreenType.MenuScreen);
|
||||||
|
|
||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,11 +57,13 @@ public class PvAIModePopup : PopupBase
|
|||||||
Debug.Log($"Starting PVP Mode with {selectedPlayerCount} players:");
|
Debug.Log($"Starting PVP Mode with {selectedPlayerCount} players:");
|
||||||
Debug.Log($"Player 1: {playerName}");
|
Debug.Log($"Player 1: {playerName}");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClick_closeBtn()
|
private void OnClick_closeBtn()
|
||||||
{
|
{
|
||||||
screenManager = screenManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>() : screenManager;
|
screenManager = screenManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>() : screenManager;
|
||||||
screenManager.ShowScreen(ScreenType.MenuHUDScreen);
|
screenManager.ShowScreen(ScreenType.MenuScreen);
|
||||||
|
|
||||||
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
||||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||||
|
|||||||
208
Assets/Scripts/UI/Pages/PopUp/PvPModePopup.cs
Normal file
208
Assets/Scripts/UI/Pages/PopUp/PvPModePopup.cs
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class PvPModePopup : PopupBase
|
||||||
|
{
|
||||||
|
[Header("Buttons")]
|
||||||
|
[SerializeField] private Button twoPlayerBtn;
|
||||||
|
[SerializeField] private Button threePlayerBtn;
|
||||||
|
[SerializeField] private Button fourPlayerBtn;
|
||||||
|
[SerializeField] private Button switchBtn;
|
||||||
|
[SerializeField] private Button playBtn;
|
||||||
|
[SerializeField] private Button closeBtn;
|
||||||
|
|
||||||
|
[Header("Input Field")]
|
||||||
|
[SerializeField] private TMP_InputField playerOneNameInput;
|
||||||
|
[SerializeField] private TMP_InputField playerTwoNameInput;
|
||||||
|
[SerializeField] private TMP_InputField playerThreeNameInput;
|
||||||
|
[SerializeField] private TMP_InputField playerFourNameInput;
|
||||||
|
|
||||||
|
[Header("Player Names")]
|
||||||
|
private string playerOneName;
|
||||||
|
private string playerTwoName;
|
||||||
|
private string playerThreeName;
|
||||||
|
private string playerFourName;
|
||||||
|
|
||||||
|
[Header("References")]
|
||||||
|
[SerializeField] private GameObject playerNameInputParent1;
|
||||||
|
[SerializeField] private GameObject playerNameInputParent2;
|
||||||
|
|
||||||
|
[Header("Placeholders")]
|
||||||
|
[SerializeField] private TMP_Text playerOnePlaceholder;
|
||||||
|
[SerializeField] private TMP_Text playerTwoPlaceholder;
|
||||||
|
[SerializeField] private TMP_Text playerThreePlaceholder;
|
||||||
|
[SerializeField] private TMP_Text playerFourPlaceholder;
|
||||||
|
|
||||||
|
private ScreenManager screenManager;
|
||||||
|
private GameManager gameManager;
|
||||||
|
private SoundManager soundManager;
|
||||||
|
private int selectedPlayerCount;
|
||||||
|
public int SelectedPlayerCount => selectedPlayerCount;
|
||||||
|
|
||||||
|
[Header("Horizontal Rows (P1–P4)")]
|
||||||
|
public List<GameObject> rows;
|
||||||
|
private int hiddenIndex = 0;
|
||||||
|
|
||||||
|
Dictionary<PlayerType, string> playerNameMap = new();
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
twoPlayerBtn.onClick.AddListener(OnClick_TwoPlayerBtn);
|
||||||
|
threePlayerBtn.onClick.AddListener(OnClick_ThreePlayerBtn);
|
||||||
|
fourPlayerBtn.onClick.AddListener(OnClick_FourPlayerBtn);
|
||||||
|
playBtn.onClick.AddListener(OnClick_PlayBtn);
|
||||||
|
closeBtn.onClick.AddListener(OnClick_CloseBtn);
|
||||||
|
switchBtn.onClick.AddListener(OnClick_SwitchBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
twoPlayerBtn.onClick.RemoveListener(OnClick_TwoPlayerBtn);
|
||||||
|
threePlayerBtn.onClick.RemoveListener(OnClick_ThreePlayerBtn);
|
||||||
|
fourPlayerBtn.onClick.RemoveAllListeners();
|
||||||
|
playBtn.onClick.RemoveListener(OnClick_PlayBtn);
|
||||||
|
closeBtn.onClick.RemoveListener(OnClick_CloseBtn);
|
||||||
|
switchBtn.onClick.RemoveListener(OnClick_SwitchBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClick_TwoPlayerBtn()
|
||||||
|
{
|
||||||
|
switchBtn.gameObject.SetActive(true);
|
||||||
|
selectedPlayerCount = 2;
|
||||||
|
playerNameInputParent2.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClick_ThreePlayerBtn()
|
||||||
|
{
|
||||||
|
switchBtn.gameObject.SetActive(true);
|
||||||
|
selectedPlayerCount = 3;
|
||||||
|
playerNameInputParent1.SetActive(true);
|
||||||
|
playerNameInputParent2.SetActive(true);
|
||||||
|
UpdateInputFieldsVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClick_FourPlayerBtn()
|
||||||
|
{
|
||||||
|
switchBtn.gameObject.SetActive(false);
|
||||||
|
selectedPlayerCount = 4;
|
||||||
|
playerNameInputParent1.SetActive(true);
|
||||||
|
playerNameInputParent2.SetActive(true);
|
||||||
|
UpdateInputFieldsVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateInputFieldsVisibility()
|
||||||
|
{
|
||||||
|
playerOneNameInput.transform.parent.gameObject.SetActive(true);
|
||||||
|
playerTwoNameInput.transform.parent.gameObject.SetActive(selectedPlayerCount >= 3);
|
||||||
|
playerThreeNameInput.transform.parent.gameObject.SetActive(selectedPlayerCount >= 2);
|
||||||
|
playerFourNameInput.transform.parent.gameObject.SetActive(selectedPlayerCount >= 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClick_PlayBtn()
|
||||||
|
{
|
||||||
|
int logicalIndex = 0;
|
||||||
|
|
||||||
|
foreach (GameObject row in rows)
|
||||||
|
{
|
||||||
|
if (!row.activeSelf)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
TMP_InputField input = row.GetComponentInChildren<TMP_InputField>();
|
||||||
|
|
||||||
|
PlayerType playerType = (PlayerType)logicalIndex;
|
||||||
|
|
||||||
|
string playerName = string.IsNullOrWhiteSpace(input.text)
|
||||||
|
? playerType.ToString()
|
||||||
|
: input.text;
|
||||||
|
|
||||||
|
playerNameMap[playerType] = playerName;
|
||||||
|
logicalIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// playerOneName = string.IsNullOrWhiteSpace(playerOneNameInput.text) ? Ludo_3D_Constants.Player1_Name : playerOneNameInput.text;
|
||||||
|
// playerTwoName = string.IsNullOrWhiteSpace(playerTwoNameInput.text) ? Ludo_3D_Constants.Player1_Name : playerTwoNameInput.text;
|
||||||
|
// playerThreeName = string.IsNullOrWhiteSpace(playerThreeNameInput.text) ? Ludo_3D_Constants.Player1_Name : playerThreeNameInput.text;
|
||||||
|
// playerFourName = string.IsNullOrWhiteSpace(playerFourNameInput.text) ? Ludo_3D_Constants.Player1_Name : playerFourNameInput.text;
|
||||||
|
|
||||||
|
playerOneName = playerNameMap.GetValueOrDefault(PlayerType.Player1, Ludo_3D_Constants.Player1_Name);
|
||||||
|
playerTwoName = playerNameMap.GetValueOrDefault(PlayerType.Player2, Ludo_3D_Constants.Player2_Name);
|
||||||
|
playerThreeName = playerNameMap.GetValueOrDefault(PlayerType.Player3, Ludo_3D_Constants.Player3_Name);
|
||||||
|
playerFourName = playerNameMap.GetValueOrDefault(PlayerType.Player4, Ludo_3D_Constants.Player4_Name);
|
||||||
|
|
||||||
|
|
||||||
|
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
||||||
|
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||||
|
|
||||||
|
//TODO: Start PVP Game with the selected player count and names
|
||||||
|
Debug.Log($"Starting PVP Mode with {selectedPlayerCount} players:");
|
||||||
|
Debug.Log($"Player 1: {playerOneName}");
|
||||||
|
Debug.Log($"Player 2: {playerTwoName}");
|
||||||
|
if (selectedPlayerCount >= 3)
|
||||||
|
Debug.Log($"Player 3: {playerThreeName}");
|
||||||
|
if (selectedPlayerCount == 4)
|
||||||
|
Debug.Log($"Player 4: {playerFourName}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClick_SwitchBtn()
|
||||||
|
{
|
||||||
|
if (SelectedPlayerCount == 2)
|
||||||
|
{
|
||||||
|
if (playerNameInputParent1.activeSelf)
|
||||||
|
{
|
||||||
|
playerNameInputParent1.SetActive(false);
|
||||||
|
playerNameInputParent2.SetActive(true);
|
||||||
|
playerOnePlaceholder.text = "Player 1";
|
||||||
|
playerThreePlaceholder.text = "Player 2";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playerNameInputParent1.SetActive(true);
|
||||||
|
playerNameInputParent2.SetActive(false);
|
||||||
|
playerTwoPlaceholder.text = "Player 1";
|
||||||
|
playerFourPlaceholder.text = "Player 2";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (SelectedPlayerCount == 3)
|
||||||
|
{
|
||||||
|
hiddenIndex = (hiddenIndex + 1) % rows.Count;
|
||||||
|
UpdateRows();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateRows()
|
||||||
|
{
|
||||||
|
int visiblePlayerIndex = 1;
|
||||||
|
|
||||||
|
for (int i = 0; i < rows.Count; i++)
|
||||||
|
{
|
||||||
|
bool isHidden = (i == hiddenIndex);
|
||||||
|
rows[i].SetActive(!isHidden);
|
||||||
|
|
||||||
|
if (!isHidden)
|
||||||
|
{
|
||||||
|
TMP_InputField input =
|
||||||
|
rows[i].GetComponentInChildren<TMP_InputField>();
|
||||||
|
|
||||||
|
TMP_Text placeholder = input.placeholder as TMP_Text;
|
||||||
|
if (placeholder != null)
|
||||||
|
{
|
||||||
|
placeholder.text = $"Player {visiblePlayerIndex}";
|
||||||
|
visiblePlayerIndex++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClick_CloseBtn()
|
||||||
|
{
|
||||||
|
screenManager = screenManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>() : screenManager;
|
||||||
|
screenManager.ShowScreen(ScreenType.MenuScreen);
|
||||||
|
|
||||||
|
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
||||||
|
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||||
|
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,18 +12,19 @@ public class GameHUDS : ScreenBase
|
|||||||
[SerializeField] private TMP_Text diceCountText;
|
[SerializeField] private TMP_Text diceCountText;
|
||||||
[SerializeField] private TMP_Text playerTurnText;
|
[SerializeField] private TMP_Text playerTurnText;
|
||||||
|
|
||||||
SoundManager soundManager;
|
private SoundManager soundManager;
|
||||||
|
private UIManager uiManager;
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
pauseBtn.onClick.AddListener(OnClick_pauseBtn);
|
pauseBtn.onClick.AddListener(OnClick_pauseBtn);
|
||||||
diceBtn.onClick.AddListener(OnClick_diceBtn);
|
diceBtn.onClick.AddListener(OnClick_DiceBtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDisable()
|
private void OnDisable()
|
||||||
{
|
{
|
||||||
pauseBtn.onClick.RemoveListener(OnClick_pauseBtn);
|
pauseBtn.onClick.RemoveListener(OnClick_pauseBtn);
|
||||||
diceBtn.onClick.RemoveListener(OnClick_diceBtn);
|
diceBtn.onClick.RemoveListener(OnClick_DiceBtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClick_pauseBtn()
|
private void OnClick_pauseBtn()
|
||||||
@ -37,9 +38,9 @@ public class GameHUDS : ScreenBase
|
|||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClick_diceBtn()
|
private void OnClick_DiceBtn()
|
||||||
{
|
{
|
||||||
Dice dice = InterfaceManager.Instance?.GetInterfaceInstance<Dice>();
|
uiManager = uiManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<UIManager>() : uiManager;
|
||||||
dice?.Roll();
|
uiManager.OnDiceViewInteracted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,93 +0,0 @@
|
|||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
public class PvPModePopup : PopupBase
|
|
||||||
{
|
|
||||||
[Header("Buttons")]
|
|
||||||
[SerializeField] private Button twoPlayerBtn;
|
|
||||||
[SerializeField] private Button threePlayerBtn;
|
|
||||||
[SerializeField] private Button fourPlayerBtn;
|
|
||||||
[SerializeField] private Button playBtn;
|
|
||||||
[SerializeField] private Button closeBtn;
|
|
||||||
|
|
||||||
[Header("Input Field")]
|
|
||||||
[SerializeField] private TMP_InputField playerOneNameInput;
|
|
||||||
[SerializeField] private TMP_InputField playerTwoNameInput;
|
|
||||||
[SerializeField] private TMP_InputField playerThreeNameInput;
|
|
||||||
[SerializeField] private TMP_InputField playerFourNameInput;
|
|
||||||
|
|
||||||
[Header("Player Names")]
|
|
||||||
private string playerOneName;
|
|
||||||
private string playerTwoName;
|
|
||||||
private string playerThreeName;
|
|
||||||
private string playerFourName;
|
|
||||||
|
|
||||||
private ScreenManager screenManager;
|
|
||||||
private SoundManager soundManager;
|
|
||||||
private int selectedPlayerCount;
|
|
||||||
public int SelectedPlayerCount => selectedPlayerCount;
|
|
||||||
|
|
||||||
private void OnEnable()
|
|
||||||
{
|
|
||||||
twoPlayerBtn.onClick.AddListener(() => OnPlayerCountSelected(2));
|
|
||||||
threePlayerBtn.onClick.AddListener(() => OnPlayerCountSelected(3));
|
|
||||||
fourPlayerBtn.onClick.AddListener(() => OnPlayerCountSelected(4));
|
|
||||||
playBtn.onClick.AddListener(OnClick_playBtn);
|
|
||||||
closeBtn.onClick.AddListener(OnClick_closeBtn);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDisable()
|
|
||||||
{
|
|
||||||
twoPlayerBtn.onClick.RemoveAllListeners();
|
|
||||||
threePlayerBtn.onClick.RemoveAllListeners();
|
|
||||||
fourPlayerBtn.onClick.RemoveAllListeners();
|
|
||||||
playBtn.onClick.RemoveAllListeners();
|
|
||||||
closeBtn.onClick.RemoveAllListeners();
|
|
||||||
}
|
|
||||||
private void OnPlayerCountSelected(int count)
|
|
||||||
{
|
|
||||||
selectedPlayerCount = count;
|
|
||||||
UpdateInputFieldsVisibility();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateInputFieldsVisibility()
|
|
||||||
{
|
|
||||||
playerOneNameInput.transform.parent.gameObject.SetActive(true);
|
|
||||||
playerTwoNameInput.transform.parent.gameObject.SetActive(selectedPlayerCount >= 2);
|
|
||||||
playerThreeNameInput.transform.parent.gameObject.SetActive(selectedPlayerCount >= 3);
|
|
||||||
playerFourNameInput.transform.parent.gameObject.SetActive(selectedPlayerCount >= 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnClick_playBtn()
|
|
||||||
{
|
|
||||||
playerOneName = playerOneNameInput.text;
|
|
||||||
playerTwoName = playerTwoNameInput.text;
|
|
||||||
playerThreeName = playerThreeNameInput.text;
|
|
||||||
playerFourName = playerFourNameInput.text;
|
|
||||||
|
|
||||||
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
|
||||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
|
||||||
|
|
||||||
//TODO: Start PVP Game with the selected player count and names
|
|
||||||
Debug.Log($"Starting PVP Mode with {selectedPlayerCount} players:");
|
|
||||||
Debug.Log($"Player 1: {playerOneName}");
|
|
||||||
Debug.Log($"Player 2: {playerTwoName}");
|
|
||||||
if (selectedPlayerCount >= 3)
|
|
||||||
Debug.Log($"Player 3: {playerThreeName}");
|
|
||||||
if (selectedPlayerCount == 4)
|
|
||||||
Debug.Log($"Player 4: {playerFourName}");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnClick_closeBtn()
|
|
||||||
{
|
|
||||||
screenManager = screenManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>() : screenManager;
|
|
||||||
screenManager.ShowScreen(ScreenType.MenuHUDScreen);
|
|
||||||
|
|
||||||
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
|
||||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
|
||||||
|
|
||||||
Hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user