using UnityEngine.SceneManagement: How to use, etc?
This site says I have to use the line
" using UnityEngine.SceneManagement; "
in order to use the function LoadScene. I assumed this just goes on the top of the script as is, and I did so, placing it right beneath the pragma strict. However, I am getting error "Assets/LoadScene.js(2,6): UCE0001: ';' expected. Insert a semicolon at the end."
here is the script:
#pragma strict
using UnityEngine.SceneManagement;
public static function LoadScene(sceneName: String, mode: SceneManagement.LoadSceneMode)
{
mode = LoadSceneMode.Single;
SceneManager.LoadScene(sceneName);
}
As far as the official Scripting document states, there doesn't need to be a semicolon in (line 2, position 6). Can anyone explain why the compiler wants me to a semicolon somewhere where it doesn't belong?
Answer by Zoogyburger · Mar 15, 2016 at 04:02 AM
In javascript, use
import UnityEngine.SceneManagement;
that's weird, the site says to say using ins$$anonymous$$d of import. Not sure what's up with that, but thanks nevertheless
@JetStreak Yeah, the official Unity $$anonymous$$anual is totally wrong on this one.
Your answer
Follow this Question
Related Questions
Expecting }, found 'static' 2 Answers
How To Make A Kill Counter 1 Answer
Semicolon expected before end of line 0 Answers
Where to put ; 2 Answers
';' expected. Insert a semicolon at the end. Already have one 1 Answer