Beispiel #1
0
    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);
        }
    }
Beispiel #3
0
 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>();
 }
Beispiel #4
0
    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);
    }
Beispiel #5
0
    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);
    }
Beispiel #7
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Beispiel #8
0
 private void YesLogout()
 {
     if (DBManager.LoggedInWithEmail)
     {
         //DBManager.LogOutfromEmailandName();
         DBManager.LogOutfromEmail();
         Scenemanager.ReloadCurrentScene(true);
     }
     else if (DBManager.GetUserName)
     {
         //DBManager.LogOutfromEmailandName();
         DBManager.LogOutfromUserName();
         Scenemanager.ReloadCurrentScene(true);
     }
 }
Beispiel #9
0
    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()
 }
Beispiel #11
0
 private void GoToMainMenu()
 {
     Scenemanager.Loadscene("MainMenu");
 }
Beispiel #12
0
 private void GoToLoginMenu()
 {
     Scenemanager.Loadscene("LoginMenu");
 }
Beispiel #13
0
 // Use this for initialization
 void Start()
 {
     scenemanager = FindObjectOfType <Scenemanager>();
     timetext     = GetComponent <Text>();
 }
Beispiel #14
0
    void Awake()
    {
        instance = this;

        DontDestroyOnLoad(instance);
    }
Beispiel #15
0
 private void GoToLoginviaName()
 {
     Scenemanager.Loadscene("LoginMenuWithName");
 }
Beispiel #16
0
 private void GoToRegister()
 {
     Scenemanager.Loadscene("RegisterMenu");
 }
Beispiel #17
0
    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
    }