Compare commits

...

2 Commits

Author SHA1 Message Date
9d6d2599e1 Updated Main Menu screen type. 2026-01-30 23:29:49 +05:30
d1836cf10c Updated Finishing tiles logic. 2026-01-30 23:27:56 +05:30
7 changed files with 1610 additions and 1166 deletions

View File

@ -0,0 +1,48 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8621343442563501342
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8621343442563501343}
- component: {fileID: 8621343442563501340}
m_Layer: 0
m_Name: FinishingPathWaypoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8621343442563501343
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8621343442563501342}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.12, y: 0, z: -14.976}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8621343442563501340
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8621343442563501342}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: be69a8cfb3b2940308cbac570565e629, type: 3}
m_Name:
m_EditorClassIdentifier:
isSafeZone: 0
centeredPoint: {fileID: 8621343442563501343}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b9f6f4c66b5a34d7eb7286e772505389
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -680,6 +680,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 : finishingPathIndex + diceRolledValue;
Debug.Log($"TargetIdx: {targetIdx}, finishingPathIndex: {finishingPathIndex}");
DisplayPlayerCountOnTile(playerPawn, false);
MoveThroughFinishingPath(playerPawn, finishingPathIndex, targetIdx);
}
@ -932,9 +933,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
{
UpdatePlayerState(playerPawn, PlayerState.InFinishingPath);
DisplayPlayerCountOnTile(playerPawn, false);
playerPawn.MoveToTile(
tilesManager.RetrievePositionForFinishingTile(currentPlayerTypeTurn, index).position,
tilesManager.RetrieveFinishingTileBasedOnIndex(currentPlayerTypeTurn, index).transform.position,
onComplete: () =>
{
diceRolledValue--;
@ -1018,7 +1018,10 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
private void DisplayPlayerCountOnTile(PlayerPawn playerPawn, bool show)
{
Tile tile = tilesManager.RetrieveTileBasedOnIndex(playerPawn.CurrentTileIndex);
Tile tile = playerPawn.GetPlayerState() == PlayerState.InFinishingPath ?
tilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, playerPawn.CurrentTileIndex)
: tilesManager.RetrieveTileBasedOnIndex(playerPawn.CurrentTileIndex);
Debug.Log($"Displaycount: {playerPawn.name} on tile: {tile.name}, show: {show}");
playerPawn.ShowPlayerCountCanvas(show);
if (!show) return;

View File

@ -65,7 +65,6 @@ public class SafeTile : Tile
placementQueue.Enqueue(playerTypesDict[playerType].commonPlacementTransform);
playerTypesDict.Remove(playerType);
Debug.Log($"targetSafeTile. tileName: {name} Removing player {playerType}");
lastOccupiedIndex--;
}
}
}

View File

@ -25,8 +25,6 @@ public class Tile : MonoBehaviour
public Vector3 CenterPlacementPosition => centeredPoint.position;
protected int lastOccupiedIndex = 0;
private List<PlayerPawn> PlayerPawns = new List<PlayerPawn>(); // Change implementation
public bool HasPawnsAvailable => PlayerPawns.Count > 0;

View File

@ -18,7 +18,7 @@ public class TilesManager : MonoBehaviour, IBootLoader, IDataLoader, IBase
private GameplayManager gameplayManager;
private Dictionary<PlayerType, List<Transform>> finishingTileDataPairs = new Dictionary<PlayerType, List<Transform>>();
private Dictionary<PlayerType, List<Tile>> finishingTileDataPairs = new Dictionary<PlayerType, List<Tile>>();
public void Initialize()
{
@ -36,9 +36,9 @@ public class TilesManager : MonoBehaviour, IBootLoader, IDataLoader, IBase
{
if (gameplayManager.PlayerTypesCollection.Contains(tileData.playerType))
{
finishingTileDataPairs.Add(tileData.playerType, new List<Transform>());
finishingTileDataPairs.Add(tileData.playerType, new List<Tile>());
foreach (Transform child in tileData.playerFinishingTileParent)
finishingTileDataPairs[tileData.playerType].Add(child);
finishingTileDataPairs[tileData.playerType].Add(child.GetComponent<Tile>());
}
}
}
@ -60,8 +60,13 @@ public class TilesManager : MonoBehaviour, IBootLoader, IDataLoader, IBase
return tile;
}
public Transform RetrievePositionForFinishingTile(PlayerType playerType, int index)
public Tile RetrieveFinishingTileBasedOnIndex(PlayerType playerType, int index)
{
return finishingTileDataPairs[playerType][index];
}
public Transform RetrievePositionForFinishingTile(PlayerType playerType, int index)
{
return finishingTileDataPairs[playerType][index].transform;
}
}