Fix issues
This commit is contained in:
@@ -38,14 +38,19 @@ public partial class GameManager : Node
|
||||
|
||||
public void SetP1ToPreviousCharacter() => _p1CharacterIndex = _p1CharacterIndex == 0 ? _p1Characters.Count() : --_p1CharacterIndex;
|
||||
|
||||
public void ResetPlayerPosition()
|
||||
{
|
||||
var playerSpawnPoint = GetNode<SpawnPoint>("P1SpawnPoint");
|
||||
playerSpawnPoint.SetPlayerPosition(_p1SelectedCharacter);
|
||||
}
|
||||
|
||||
public void OnP1CharacterSelected()
|
||||
{
|
||||
GD.Print("Instancing...");
|
||||
var selectedPlayer = _p1Characters[_p1CharacterIndex].Instantiate();
|
||||
_p1SelectedCharacter = selectedPlayer as Character;
|
||||
GetTree().Root.AddChild(_p1SelectedCharacter);
|
||||
var playerSpawnPoint = GetNode<SpawnPoint>("P1SpawnPoint");
|
||||
playerSpawnPoint.SetPlayerPosition(_p1SelectedCharacter);
|
||||
ResetPlayerPosition();
|
||||
}
|
||||
|
||||
public void RemoveP1Character()
|
||||
|
||||
Reference in New Issue
Block a user