QPong / QPong-Unity

QPong rewritten in Unity
26 stars 6 forks source link

Transition to EndGame and restart the game #39

Closed HuangJunye closed 5 years ago

HuangJunye commented 5 years ago

I want to add transition to EndGame scene and from there press any key to restart the game. To restart the game, I need to reset the score and circuit. I see @filemaster added RestartGame in GameManager.cs, but I have problem accessing to gameManager once I go to the EndGame scene. Should I add DontDestroyOnLoad(transform.gameObject) to GameManager.cs?

HuangJunye commented 5 years ago

In the EndGame scene, we should ask player to input their name for the ranking.

boland25 commented 5 years ago

GameController is a singelton instance so you should be able to get at it everywhere by saying GameController.Instance.methodYouWantToCall()

boland25 commented 5 years ago

and yes entering player initials is a good one. we need that for hello quantum too, so maybe assigm that to @filemaster as an issue

HuangJunye commented 5 years ago

I can access GameController but the restart method is under GameManager. At the end I release only thing I need to reset is the player score and it can be accessed in GameController. I made the commit for that.

filemaster commented 5 years ago

@HuangJunye I will do it. GameManager is instantiated every time the game scene is loaded, so all its variables will be reset automatically.