What's the level, Kenneth?
by Zilla · in Torque X 2D · 06/12/2008 (1:44 pm) · 5 replies
What is the easiest way to determine which level is loaded, so that I can trigger the actions in the code:
e.g.
if level==1 then do this
if level==2 then do that
e.g.
if level==1 then do this
if level==2 then do that
#2
06/13/2008 (10:48 am)
SceneLoader.LastLoadedScene?
#3
06/13/2008 (12:05 pm)
Where is this documented?
#4
John K.
06/13/2008 (3:07 pm)
I'll check the scene loader code to see if there's a property that exposes the filename, but I really doubt that there is one. It seems to me that it would be easier to track that in your Game class. Add a property, like: public int CurrentLevel = 1; Then, each time you load a new level, increment this property. Then, anywhere you need to check you can do something like: if( Game.Instance.CurrentLevel == 1 ). John K.
Torque 3D Owner Kenneth Holst
Default Studio Name