1 I want to press Start and be taken to the first level
Start scene - At the moment the OnClick()
event in the Button component on your Przycisk Start Text is set to call the LoadNextLevel()
method within LevelManager. Whilst the code you have is using the deprecated methods (e.g. Application.loadedLevel
) this should still work.
Please confirm step 1 is working as expected.
2 If I lose on this level I want to be able to click Restart and be taken back to the first level to play again, not the Menu. Everytime I press RESTART buttom I will start at first level and I’ll have to beat all game again ( for now )
Lose scene - At the moment the OnClick()
event in the Button component on your Restart Text is set to call the LoadLevel()
method within LevelManager, passing it the scene name Level_01. Whilst the code you have is using the deprecated methods (e.g. Application.loadedLevel
) this should still work.
Debug.Log(Application.loadedLevel);
this line within the LoadLevel(string name)
will not be called. You request that a different level is loaded before it, when that level loads a new LevelManager object is instantiated, the one that you were using is destroyed, the Debug.Log
statement is lost.
Move the Debug.Log(Application.loadedLevel);
statement above the Application.LoadLevel(name);
statement.
The expected output in the console would be the index of the level being loaded, if you are restarting then I would expect this to be index 2. If you were returning to the Menu then index 1. (see item 4 below regarding scene index order).
3 If I click on Menu I want to be returned to the Menu
Win scene - At the moment the OnClick()
event in the Button component on your MenuStart Text is set to call the LoadLevel()
method within LevelManager, passing it the scene name Start. Whilst the code you have is using the deprecated methods (e.g. Application.loadedLevel
) this should still work.
Please confirm that Step 3 is working as expected.
4 If I complete the first or subsequent levels I want to be taken to the next level
LevelManager script - Looking at the method ZniszczoneLoad()
the code contained within looks like it would successfully call the LoadNextLevel()
method, which in turn would load the next level, based on the level index number. For example, if Level_04 is index number 5, then it would try to load the scene with the index of 6, presumably this is you Win scene?
Please confirm from your build settings the indexes of the scenes. You would probably want them in this order for now (Start, Level_01, Level_02, Level_03, Level_04, Win, Lose)
Please confirm that Step 4 is working as expected, that you progress from one level to the next, and if you are successful you get all the way to the Win scene.
5 If I click on Menu I will be taken back to the Menu
See Item 3 above.
6 If I complete all levels I want to see Win scene with an option to return to the Menu
Please confirm that this works as expected.
So, please respond to each part of the above and we will see where we are from that. Tagging you so that you can find this new topic more easily @Marcin_Radczyk