Compare commits

..

No commits in common. "main" and "Gameplay/siva-gameplay" have entirely different histories.

3 changed files with 21 additions and 42 deletions

View File

@ -15584,8 +15584,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 5608193482973815123}
m_RootOrder: 4
m_Father: {fileID: 5608193482405246780}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
@ -18146,7 +18146,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 5608193482973815123}
m_TransformParent: {fileID: 5608193482405246780}
m_Modifications:
- target: {fileID: 1882416428171655664, guid: 94fc731c540da43c9ab09386da3501df, type: 3}
propertyPath: m_Pivot.x
@ -18158,7 +18158,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1882416428171655664, guid: 94fc731c540da43c9ab09386da3501df, type: 3}
propertyPath: m_RootOrder
value: 2
value: 4
objectReference: {fileID: 0}
- target: {fileID: 1882416428171655664, guid: 94fc731c540da43c9ab09386da3501df, type: 3}
propertyPath: m_AnchorMax.x
@ -18202,15 +18202,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1882416428171655664, guid: 94fc731c540da43c9ab09386da3501df, type: 3}
propertyPath: m_LocalRotation.x
value: -0
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1882416428171655664, guid: 94fc731c540da43c9ab09386da3501df, type: 3}
propertyPath: m_LocalRotation.y
value: -0
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1882416428171655664, guid: 94fc731c540da43c9ab09386da3501df, type: 3}
propertyPath: m_LocalRotation.z
value: -0
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1882416428171655664, guid: 94fc731c540da43c9ab09386da3501df, type: 3}
propertyPath: m_AnchoredPosition.x
@ -19183,7 +19183,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5608193482973815123}
m_RootOrder: 5
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.00047905743, y: 0.019000001}
m_AnchorMax: {x: 0.164, y: 0.13700001}
@ -24277,7 +24277,10 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5608193482794695410}
- {fileID: 5608193482610168847}
- {fileID: 5608193483164820607}
- {fileID: 1489264326}
- {fileID: 1763545632}
m_Father: {fileID: 5608193482973815123}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -24687,8 +24690,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5608193482973815123}
m_RootOrder: 3
m_Father: {fileID: 5608193482405246780}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -25395,9 +25398,6 @@ RectTransform:
m_Children:
- {fileID: 5608193482405246780}
- {fileID: 5608193483424667982}
- {fileID: 1763545632}
- {fileID: 5608193482610168847}
- {fileID: 1489264326}
- {fileID: 1854040023}
m_Father: {fileID: 5608193482405325761}
m_RootOrder: 1
@ -25823,7 +25823,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5608193482405246780}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}

View File

@ -50,7 +50,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
private PlayerType currentPlayerTypeTurn;
private TimerSystem currentPlayerTurnTimer;
private TimerSystem savedCurrentPlayerTurnTimerInst;
private int currentPlayerTurnIndex = 0;
private List<PlayerType> allPlayerTypes = new List<PlayerType>();
@ -96,7 +95,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
public List<PlayerData> PlayerDatas => playerDatas;
public List<PlayerType> PlayerTypesCollection => allPlayerTypes;
public Action onGameResumed = null;
public Action OnGameResumed = null;
public void Initialize()
{
@ -286,13 +285,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
onComplete?.Invoke();
}, inProgress: (remTime) =>
{
if (HasGamePausedForUser())
{
savedCurrentPlayerTurnTimerInst = currentPlayerTurnTimer;
currentPlayerTurnTimer = null;
return;
}
uIManager.UpdatePlayerTurnText(currentPlayerTypeTurn, currentPlayerMaxTime - (int)remTime);
});
}
@ -1203,18 +1195,13 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
index);
}
private bool HasGamePausedForUser()
{
return (botTypesInGame == null || !botTypesInGame.Contains(currentPlayerTypeTurn)) &&
GameManager.CurrentGameState == GameState.IsPaused;
}
public void CheckForGamePause(Action onComplete)
{
Debug.Log($"CheckForGamePause: {GameManager.CurrentGameState == GameState.IsPaused}");
if (HasGamePausedForUser())
if ((botTypesInGame == null || !botTypesInGame.Contains(currentPlayerTypeTurn)) &&
GameManager.CurrentGameState == GameState.IsPaused)
{
onGameResumed = onComplete;
OnGameResumed = onComplete;
}
else
{
@ -1222,13 +1209,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
}
}
public void OnGameResumed()
{
onGameResumed?.Invoke();
currentPlayerTurnTimer = savedCurrentPlayerTurnTimerInst;
savedCurrentPlayerTurnTimerInst = null;
}
private void MoveThroughFinishingPath(PlayerPawn playerPawn, int index, int targetIndex)
{
UpdatePlayerState(playerPawn, PlayerState.InFinishingPath);
@ -1253,7 +1233,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
{
if (playerPawn.CurrentTileIndex == TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1)
{
onGameResumed = null;
OnGameResumed = null;
Tile tile = TilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, playerPawn.CurrentTileIndex);
tile.InitPlayerPawn(playerPawn, playerPawn.PlayerType);
// ShowUpdatedPlayerCountOnTile(playerPawn);
@ -1409,9 +1389,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
ResetGameRestartData();
currentPlayerTurnTimer?.KillTimer();
savedCurrentPlayerTurnTimerInst = null;
currentPlayerTurnTimer = null;
onGameResumed = null;
OnGameResumed = null;
playerDatas = null;
allPlayerTypes = null;

View File

@ -40,7 +40,7 @@ public class PauseMenuPopup : PopupBase
screenManager.ShowScreen(ScreenType.InGameHUDScreen);
SetGameModeHandler();
gameModeHandler.GameplayManager.OnGameResumed();
gameModeHandler.GameplayManager.OnGameResumed?.Invoke();
}
private void OnClick_HomeButton()