- Home /
This question was
closed Oct 13, 2016 at 07:39 PM by
Nova-1504 for the following reason:
No one is answering!
Question by
Nova-1504 · Oct 11, 2016 at 05:22 AM ·
scene-loadingapplication.loadlevelidentifierunknownunknown identifier
Unknown Identifier SceneManager/Obsolete Application.LoadLevel
#pragma strict
if(Input.GetKeyDown(KeyCode.Alpha1)||Input.GetKeyDown(KeyCode.Keypad1)){
SceneManager.LoadScene(1);
}
if(Input.GetKeyDown(KeyCode.Alpha2)||Input.GetKeyDown(KeyCode.Keypad2)){
Application.Quit();
}
When I use Application.LoadLevel, it's obsolete. SceneManager is unknown. Why!!!
Comment
Answer by doublemax · Oct 11, 2016 at 05:27 AM
Add "using UnityEngine.SceneManagement;" to your script to use SceneManager,
Now when I use "using" it says there has to be a semicolon after the word using. But when I do that it says it's unknown.
Are you talking C# or UnityScript? $$anonymous$$y script is in UnityScript.
I'm going to close this because no one's answering. I'll re-ask the question separately.
Sorry, i overlooked that you were using JavaScript. There you have to use this ins$$anonymous$$d of "using":
import UnityEngine.Scene$$anonymous$$anagement;