error CS0101: The namespace `global::' already contains a definition for `SceneManagerLoadScene'
Hi! I was just making a project, however, i wanted 2 ways to load a scene. 1. on click in UI. 2. clicking on a game object. However, unity keeps saying I have 2 scripts with the same public class: SceneManagerLoadScene. How do i fix this???
Here are` using System.Collections; using System.Collections.Generic; using UnityEngine;
public class SceneManagerLoadScene : MonoBehaviour {
// Use this for initialization
void OnMouseDown () {
SceneManager.LoadScene(CC);
}
// Update is called once per frame
void Update () {
}
} ` the 2 scripts
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneManagerLoadScene : MonoBehaviour
{
public void NextLevelButton(int index)
{
SceneManager.LoadScene(index);
}
public void NextLevelButton(string CC)
{
SceneManager.LoadScene(CC);
}
}
Comment
Your answer
Follow this Question
Related Questions
Save system not working for text 1 Answer
Inter Script Communication fail 1 Answer
transform.eulerAngles not working 2 Answers
NullReferenceException (Updated) 1 Answer
HELP I would like a button that leverage the AAA graphics 0 Answers