SceneManager.loadScene does nothing

Second thread of this question
I have script

using System.IO;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class DatabaseConnect : MonoBehaviour
{
    public string Username;
    public string Pass;
    public string Deluxe;
    public bool DeluxeCheck;
    public string LoginMsg;
    public static bool LoginedID;
    [SerializeField] InputField PasswordTextfield;
    [SerializeField] InputField UsernameTextfield;

    void Start()
    {
       
    }

    void Update()
    {
       
        Username = UsernameTextfield.text;
        Pass = PasswordTextfield.text;
       
    }

    public IEnumerator Register()
    {
        WWWForm form = new WWWForm();
        form.AddField("Name", Username);
        form.AddField("Password", Pass);
        form.AddField("Deluxe", Deluxe);
        WWW www = new WWW("https://tupishefteam.com/index.php", form);
        yield return www;
        if (www.error != null)
        {
            Debug.Log("Error" + www.error);
            yield break;
        }
        else if (www.text == "Вы зарегистрировались! DX подписки нет")
        {
            Debug.Log("Server connected " + www.text);
            LoginedID = true;
            LoginMsg = "Вы зарегистривовались! DX подписки нет";
            DeluxeCheck = false;
            SceneManager.LoadScene("mainmenu");
        }
        else if (www.text == "Вы зарегистрировались! DX подписка есть")
        {
            Debug.Log("Server connected " + www.text);
            LoginedID = true;
            LoginMsg = "Вы зарегистривовались! DX подписка есть";
            DeluxeCheck = true;
            SceneManager.LoadScene("mainmenu");
        }
        /*if(www.text == "Logined")
        {
            Debug.Log(www.text);
        }*/
    }

    public IEnumerator Login()
    {
        WWWForm form = new WWWForm();
        form.AddField("Name", Username);
        form.AddField("Password", Pass);
        form.AddField("Deluxe", Deluxe);
        WWW www = new WWW("https://tupishefteam.com/login.php", form);
        yield return www;
        if (www.error != null)
        {
            Debug.Log("Error" + www.error);
            yield break;
        }
        else if (www.text == "Вы вошли! DX подписки нет")
        {
            Debug.Log("Server connected " + www.text);
            LoginedID = true;
            LoginMsg = "Вы вошли! DX подписки нет";
            DeluxeCheck = false;
            SceneManager.LoadScene("mainmenu");
        }
        else if (www.text == "Вы вошли! DX подписки нет")
        {
            Debug.Log("Server connected " + www.text);
            LoginedID = true;
            LoginMsg = "Вы вошли! DX подписка есть";
            DeluxeCheck = true;
            SceneManager.LoadScene("mainmenu");
        }
        Debug.Log(www.text);
        /*if(www.text == "Logined")
        {
            Debug.Log(www.text);
        }*/
    }



    public void RegisterButton()
    {
        StartCoroutine(Register());
    }
    public void LoginButton()
    {
        StartCoroutine(Login());
    }
}

I see Debug.Log in console, but scene wasn’t loaded.

What i tried:

  • Write SceneLoadMode.Single, but it didn’t help
  • I was serfing internet to find problem resolution. it didn’t help

Help me please

Sorry for my english, i’m Russian.

Please do not open new threads for the same issue. This is your thread: https://discussions.unity.com/t/931766/8

Read Kurt‘s post in that thread.

Duplicate thread closed.