InitialScene
https://assetstore.unity.com/packages/slug/186884
Last updated
Was this helpful?
https://assetstore.unity.com/packages/slug/186884
Last updated
Was this helpful?
The InitialScene is the first scene which is loaded when the game is started on user's device. Here the user can select or buy a car, select a different map to play, change sound settings & reset it's progress from Settings dialog.
This is how the scene's hierarchy looks like ->
MainCanvas holds the main UI of the game
The main script which holds all the data here is MainMenuUi.cs.
Buttons section hold a reference to all buttons inside the MainCanvas. All click listeners are set via the script so no way you can forgot to assign something inside the Editor and it does not work.
Panels section hold a reference to Settings dialog and SelectionPanel.
CarParent is a Transform from the scene which holds the selected car model. When the user select a new car the new model / prefab is instantiated and set as a child of this transform.
Maps list holds a reference to the preview GameObjects of every map available inside the game. The previews are placed under Environment GameObject.
SkyBoxMaterials holds a reference to different skybox materials which are changed once the user selects a new map. Every map (level) has it's own skybox material with different gradient colors.
SettingsDialog holds as you probably guess....the settings - yes!
There is only three buttons here:
Close button - which close the dialog
Music button - which toggles music on\off.
Reset Progress button - which opens Reset Progress dialog.
Reset dialog as you guess again lets the user to reset his/her progress.
It's quiet simple. Two buttons:
Cancel button - Closes the dialog without resetting user's progress.
Yes button - Resets the user's progress (Clear PlayerPrefs in our case).
Selection panel let's the user to choose a different car or map.
It's quiet simple setup too. We have a few buttons:
Next button - Choose next car or map based on which button we selected (Car or Map)
Previous button - Choose the previous car or map.
Select button - Which confirms user's selected car or map (save it in PlayerPrefs).
Unlock button - Unlock or buy the current car if it's locked and the user has enough coins to purchase it.
Close button - Close Selection panel and reset selected car or map if nothing is selected via pressing Select button.
SceneLoadingManager is responsible for showing an animation while loading from InitialScene -> MainScene.
CarsManager , MapManager , CurrencyManager, SoundManager as you can guess holds the references to cars , maps, currency (coins) and used sounds inside the game.