Nuds Nuds -4 years ago 573
C# Question

SceneManager.SceneLoaded signature issues

I'm not understanding what's wrong with this implementation. Perhaps someone could shed some light on the issue. The compiler is stating that there is no overloaded method for StartGame that matches the delegate. Am I missing something silly here?

void Start()
SceneManager.sceneLoaded += this.StartGame;
director = GetComponent<Director>();

public void LoadGameLevel()

void StartGame(UnityAction<Scene, LoadSceneMode> sceneInfo)
foreach (GameObject player in players)

Answer Source

This is how the event is defined: public static event UnityAction<Scene, LoadSceneMode> sceneLoaded;


StartGame(UnityAction <Scene, LoadSceneMode> sceneInfo)


void StartGame(Scene scene, LoadSceneMode sceneMode).

That should solve your problem.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download