Page 1 of 1

LoadLevel Sequencer Command not working as expected

Posted: Tue Jun 30, 2015 8:30 pm
by BaddyDan
Hello,

I am trying to create a custom sequencer command with my own LevelManager For some reason, I am unable to access my LevelManager's public functions, as demonstrated below.
Capture.JPG
Capture.JPG (37.01 KiB) Viewed 642 times
Is there any reason why this may be happening? And also what can we do to work around this? Many thanks in advance!

Re: LoadLevel Sequencer Command not working as expected

Posted: Tue Jun 30, 2015 10:16 pm
by Tony Li
Hi,

The Dialogue System also defines a "LevelManager" class. You just need to specify which one you're referring to.

If your LevelManager script is defined in a namespace, try changing:

Code: Select all

var levelManager = FindObjectOfType<LevelManager>();
to:

Code: Select all

var levelManager = FindObjectOfType<MyNamespace.LevelManager>();
where MyNamespace is your namespace.

If your script isn't in a namespace, change it to this:

Code: Select all

var levelManager = FindObjectOfType<global::LevelManager>();