Merge branch 'main' of https://git.marlboro-bc.duckdns.org/yeahweregames/UnityTowerDefense
This commit is contained in:
commit
4e11842d3e
16 changed files with 463 additions and 19 deletions
|
|
@ -160,6 +160,26 @@ namespace TD.Gameplay
|
|||
}
|
||||
}
|
||||
|
||||
// Seed each player's tower deck with the starter set. Runs here (after the
|
||||
// one-frame yield) so the TowerPlacementManager catalog is guaranteed spawned
|
||||
// and its starting-deck assets resolve to valid TypeIds. Clearing-and-setting
|
||||
// means Retry / return-to-lobby cycles reset the deck cleanly.
|
||||
var placement = TowerPlacementManager.Instance;
|
||||
if (placement != null)
|
||||
{
|
||||
var startingTypeIds = placement.GetStartingDeckTypeIds();
|
||||
foreach (var pms in PlayerMatchState.AllPlayers)
|
||||
{
|
||||
var deck = PlayerTowerDeck.GetForClient(pms.OwnerClientId);
|
||||
if (deck != null) deck.ServerInitialize(startingTypeIds);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[WaveManager] TowerPlacementManager not found at match start. " +
|
||||
"Player decks were not seeded.");
|
||||
}
|
||||
|
||||
if (ms.Phase == MatchPhase.Playing)
|
||||
StartNextWave();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue