I have that little something that’s driving me crazy. I’m trying to fire some methods on active scene changed, so I wrote some code that looks like that :
using UnityEngine.SceneManagement;
public class LeEventManager:MonoBehaviour{
void Awake()
{
SceneManager.activeSceneChanged+=someMethod;// subscribe
}
void OnDestroy()
{
SceneManager.activeSceneChanged-=someMethod;// unsubscribe
}
(...etc)
}
But everytime the compiler tells me: " UnityEngine.SceneManagement.SceneManager does not contain a definition for activeSceneChanged".
What am I missing? Please help me, I’m unfamiliar with events and the online official documentation of activeSceneChanged is especially unhelpful.
It’s absolutely valid to check that first indeed… I’m using Unity 5.3.6f1 which is still quite new but maybe I need to update Unity before asking further questions. Thanks !
As a side note, Unity documentation is somewhat tricky: it displays by default v5.4 which is still in beta testing, and requires user action to switch back to 5.3 which is the current stable version… Not to say that it wasn’t my mistake however
Yup, but I made the comment in August and there weren’t any alpha or beta versions available at the time. In a semi-related note, I’m really looking forward to the new NavMesh and scene directing tools, but they keep pushing them back- I think they’re back in the “no idea” alpha list of future features instead of the beta list like they were a couple months ago.