IEnumerator Register() { WWWForm form = new WWWForm(); //nameField.text += "#" + Random.Range(1000, 10000); form.AddField("name", nameField.text); form.AddField("email", emailField.text); form.AddField("password", passwordField.text); WWW www = new WWW(path, form); yield return(www); if (string.IsNullOrEmpty(www.text)) { Debug.LogError("User creation failed. Response is invalid/null/empty"); Debug.LogError("Server is probably offline. Start the server from MAMP."); yield break; } if (www.text == "0") { Debug.Log("User created sucessfully."); Scenemanager.Loadscene("MainMenu"); } else { Debug.LogError("User creation failed. Error." + www.text); } }
IEnumerator LoginUser() { WWWForm form = new WWWForm(); form.AddField("name", nameField.text); form.AddField("password", passwordField.text); WWW www = new WWW(path, form); yield return(www); if (string.IsNullOrEmpty(www.text)) { Debug.LogError("User login failed. Response is invalid/null/empty"); Debug.LogError("Server is probably offline. Start the server from MAMP."); yield break; } if (www.text[0] == '0') { DBManager.username = nameField.text; Scenemanager.Loadscene("MainMenu"); } else { Debug.LogError("User login failed. Error #" + www.text); } }
void Start() { screenheight = Screen.height; screenwidth = Screen.width; _data_manager = GameObject.Find("DataManager").GetComponent<Datamanager>(); _scene_manager = GameObject.Find("SceneManager").GetComponent<Scenemanager>(); _input_manager = GameObject.Find("InputManager").GetComponent<Inputmanager>(); }
public IEnumerator LevelLoad(float WaitTime, int LV_idx) { yield return(new WaitForSeconds(WaitTime)); Scenemanager.GetComponent <AudioSource>().clip = ScenemanagerSounds[LV_idx - 1]; Scenemanager.GetComponent <AudioSource>().Play(); SceneManager.LoadScene(LV_idx); }
IEnumerator ws() { while (true) { yield return(WaitForSeconds(2)); Scenemanager.LoadScene(nex); } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); return; } _instance = this; DontDestroyOnLoad(this.gameObject); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
private void YesLogout() { if (DBManager.LoggedInWithEmail) { //DBManager.LogOutfromEmailandName(); DBManager.LogOutfromEmail(); Scenemanager.ReloadCurrentScene(true); } else if (DBManager.GetUserName) { //DBManager.LogOutfromEmailandName(); DBManager.LogOutfromUserName(); Scenemanager.ReloadCurrentScene(true); } }
void LevelSection(int levelnum, int gamemode) //levelNum set from GameModeSection new in v.1.3 - 2.0 { if (!clicked) { StartCoroutine(LevelLoad(5, levelnum)); GetComponent <AudioSource>().PlayOneShot(clickSound, .5f); GetComponent <AudioSource>().PlayOneShot(lightWind, 3); if (levelnum == 1) { Scenemanager.GetComponent <SceneGM>().GameMode = gamemode; //reseting GameMode to default CamHolder.GetComponent <Animation>().Play("MM_Way01"); //Changed to legacy animation new in v.1.3 - 2.0 } FadePanel.GetComponent <Animator>().Play("MM_FadePanelIn", -1, 0); //Scenemanager.GetComponent<SceneGM>().GameMode = 0; //0 for loading default game mode clicked = true; } }
void loadScene() { Scenemanager.LoadScene() }
private void GoToMainMenu() { Scenemanager.Loadscene("MainMenu"); }
private void GoToLoginMenu() { Scenemanager.Loadscene("LoginMenu"); }
// Use this for initialization void Start() { scenemanager = FindObjectOfType <Scenemanager>(); timetext = GetComponent <Text>(); }
void Awake() { instance = this; DontDestroyOnLoad(instance); }
private void GoToLoginviaName() { Scenemanager.Loadscene("LoginMenuWithName"); }
private void GoToRegister() { Scenemanager.Loadscene("RegisterMenu"); }
public GameObject CamHolder, FadePanel, Scenemanager; //CamHolder - plays moving animation when player choosed the level, FadePanel - smoothly fade out panel at start //SceneManager control values about gamemode or can contain any values of game features like user points and info about levels // Use this for initialization void Start() { Scenemanager = GameObject.Find("SCENEMANAGER"); //Find SceneManager at start of the game and never delete this gameobject throughout a gaming session Scenemanager.GetComponent <AudioSource>().Stop(); //stop wind background sound }