Compare commits
No commits in common. "f1e88fe0f35ff8aa6eec1dd824b17329c3bbb98f" and "273c86d5b9a3ac94d91c1543bada37e128d0ab42" have entirely different histories.
f1e88fe0f3
...
273c86d5b9
@ -630,7 +630,6 @@ MonoBehaviour:
|
||||
playerState: 0
|
||||
animator: {fileID: 5526766409186502679}
|
||||
playerCountCanvasPrefab: {fileID: 9029553984926861784}
|
||||
playerCountCanvas: {fileID: 5728752331380905399}
|
||||
--- !u!1 &4818123989977612668
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1623,17 +1622,6 @@ RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 953143927943285832, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
m_PrefabInstance: {fileID: 4537709141704337870}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &5728752331380905399 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 8176763997504289913, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
m_PrefabInstance: {fileID: 4537709141704337870}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9029553984926861784}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 12325a6692b2349b5992ec00a2cf8162, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &9029553984926861784 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 4879164135252893718, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
|
||||
@ -630,7 +630,6 @@ MonoBehaviour:
|
||||
playerState: 0
|
||||
animator: {fileID: 5274388487207906813}
|
||||
playerCountCanvasPrefab: {fileID: 6862258105288866118}
|
||||
playerCountCanvas: {fileID: 7923051124467737897}
|
||||
--- !u!1 &5059623752267150313
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1672,14 +1671,3 @@ GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 4879164135252893718, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
m_PrefabInstance: {fileID: 2057554100330600784}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &7923051124467737897 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 8176763997504289913, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
m_PrefabInstance: {fileID: 2057554100330600784}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6862258105288866118}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 12325a6692b2349b5992ec00a2cf8162, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
||||
@ -202,7 +202,6 @@ MonoBehaviour:
|
||||
playerState: 0
|
||||
animator: {fileID: 232863433340697214}
|
||||
playerCountCanvasPrefab: {fileID: 2911420982173280738}
|
||||
playerCountCanvas: {fileID: 1920934309388072333}
|
||||
--- !u!136 &1627116187348267135
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1662,17 +1661,6 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
--- !u!114 &1920934309388072333 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 8176763997504289913, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
m_PrefabInstance: {fileID: 7769048123306772980}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2911420982173280738}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 12325a6692b2349b5992ec00a2cf8162, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &2911420982173280738 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 4879164135252893718, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
|
||||
@ -1259,7 +1259,6 @@ MonoBehaviour:
|
||||
playerState: 0
|
||||
animator: {fileID: 7800412279828783518}
|
||||
playerCountCanvasPrefab: {fileID: 4593694095142779203}
|
||||
playerCountCanvas: {fileID: 941219433310479660}
|
||||
--- !u!1 &7074820051352815849
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1662,17 +1661,6 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
--- !u!114 &941219433310479660 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 8176763997504289913, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
m_PrefabInstance: {fileID: 8968445451050703189}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4593694095142779203}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 12325a6692b2349b5992ec00a2cf8162, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &4593694095142779203 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 4879164135252893718, guid: a925361762f504380a8aa4d7eb87b32c, type: 3}
|
||||
|
||||
@ -24,7 +24,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
[SerializeField] private int diceValue = 0;
|
||||
[SerializeField] private int maxDiceSixRollCounter = 2;
|
||||
[SerializeField] private int totalStepsForCharacter = 57;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI diceText;
|
||||
|
||||
@ -465,24 +464,16 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
private void FindPossibleTileData(PlayerPawn playerPawn, out int possibleSteps, out Tile possibleTileData)
|
||||
{
|
||||
int lastStepGenTile = totalStepsForCharacter - tilesManager.GetFinishingTileDataLength(playerPawn.PlayerType);//playerGameDatasDict[playerPawn.PlayerType].endIndex;
|
||||
possibleSteps = playerGameDatasDict[playerPawn.PlayerType].playerPawnsDict[playerPawn.PlayerId].StepsTaken + diceRolledValue;
|
||||
int lastStepGenTileIdx = playerGameDatasDict[playerPawn.PlayerType].endIndex;
|
||||
int possibleTileIndex = playerPawn.CurrentTileIndex + diceRolledValue;
|
||||
|
||||
int totalStepsInGeneralPath = tilesManager.GetGeneralTilesLength() - 1; // including the first safe zone
|
||||
int lastTileIndex = tilesManager.GetGeneralTilesLength() - 1;
|
||||
bool canGoingInsideFinishingPath = IsGoingInsideFinishingPath(playerPawn, out possibleSteps);
|
||||
int index = possibleSteps > totalStepsInGeneralPath ? possibleTileIndex - lastStepGenTileIdx - 1
|
||||
: possibleTileIndex > lastTileIndex ? possibleTileIndex - lastTileIndex - 1 : possibleTileIndex;
|
||||
|
||||
int index = canGoingInsideFinishingPath ? possibleSteps - lastStepGenTile - 1
|
||||
: possibleTileIndex > lastTileIndex ? possibleTileIndex - lastTileIndex - 1 : possibleTileIndex; // case for addressing the scenario when going through the last index of general tiles.
|
||||
|
||||
Debug.Log($"possibleTileIndex: {possibleTileIndex}, lastStepGenTileIdx: {lastStepGenTile}");
|
||||
Debug.Log($"index: {index}");
|
||||
possibleTileData = canGoingInsideFinishingPath ? tilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, index) : tilesManager.RetrieveTileBasedOnIndex(index);
|
||||
}
|
||||
|
||||
public bool IsGoingInsideFinishingPath(PlayerPawn playerPawn, out int possibleSteps)
|
||||
{
|
||||
possibleSteps = playerGameDatasDict[playerPawn.PlayerType].playerPawnsDict[playerPawn.PlayerId].StepsTaken + diceRolledValue;
|
||||
return possibleSteps > tilesManager.GetGeneralTilesLength() - 1;
|
||||
possibleTileData = possibleSteps > totalStepsInGeneralPath ? tilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, index) : tilesManager.RetrieveTileBasedOnIndex(index);
|
||||
}
|
||||
|
||||
public void OnDiceRolled(int rolledVal)
|
||||
@ -1079,7 +1070,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
count = tile.TotalPawnsInTile;
|
||||
}
|
||||
|
||||
playerPawn.PlayerCountCanvas.SetPlayerCount(count);
|
||||
playerPawn.GetComponentInChildren<PlayerCountCanvas>().SetPlayerCount(count);
|
||||
}
|
||||
|
||||
public void ResetData()
|
||||
|
||||
@ -90,36 +90,10 @@ public class PlayerPawn : MonoBehaviour
|
||||
TilesManager tilesManager = InterfaceManager.Instance.GetInterfaceInstance<TilesManager>();
|
||||
gameplayManager = gameplayManager ?? InterfaceManager.Instance.GetInterfaceInstance<GameplayManager>();
|
||||
|
||||
Vector3 lookDirection = Vector3.zero;
|
||||
|
||||
if (playerState == PlayerState.InFinishingPath)
|
||||
{
|
||||
int nextIndex = CurrentTileIndex + 1;
|
||||
int maxIndex = tilesManager.GetFinishingTileDataLength(PlayerType) - 1;
|
||||
|
||||
if (nextIndex <= maxIndex)
|
||||
{
|
||||
lookDirection = tilesManager.RetrieveFinishingTileBasedOnIndex(PlayerType, nextIndex).transform.position - transform.position;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gameplayManager.IsGoingInsideFinishingPath(this, out int possibleSteps))
|
||||
{
|
||||
lookDirection =tilesManager.RetrieveFinishingTileBasedOnIndex(PlayerType, 0).transform.position - transform.position;
|
||||
}
|
||||
else
|
||||
{
|
||||
int nextIndex = gameplayManager.GetNextGeneralTileIndex(this);
|
||||
lookDirection = tilesManager.RetrieveTileBasedOnIndex(nextIndex).transform.position - transform.position;
|
||||
}
|
||||
}
|
||||
|
||||
int nextTileIndex = gameplayManager.GetNextGeneralTileIndex(this);
|
||||
Vector3 lookDirection = tilesManager.RetrieveTileBasedOnIndex(nextTileIndex).transform.position - transform.position;
|
||||
lookDirection.y = 0;
|
||||
if (lookDirection != Vector3.zero)
|
||||
{
|
||||
transform.DOLookAt(transform.position + lookDirection, 0.2f);
|
||||
}
|
||||
|
||||
onComplete?.Invoke();
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user