A different Approach to refering to LevelManager class

Hi ,
I used a different approach to accessing the Level Manager class. Instead of publicly exposing the class in the inspector… I did it by creating new instance

void OnTriggerEnter2D(Collider2D col)
	Debug.Log ("Trigger");
	LevelManager l = new LevelManager (); 
	l.LoadLevel ("Win");

is there anything wrong about this?? Is it inefficient??

Personally, I just called the LevelManager using the namespace hierarchy in C# as:

LevelManager.LoadLevel (“Quit”);

No instance required.

Privacy & Terms