コード例 #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);
        }
    }
コード例 #2
0
    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);
        }
    }
コード例 #3
0
ファイル: Ui.cs プロジェクト: xiaoshichang/destory_star
 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>();
 }
コード例 #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);
    }
コード例 #5
0
    IEnumerator ws()
    {
        while (true)
        {
            yield return(WaitForSeconds(2));

            Scenemanager.LoadScene(nex);
        }
    }
コード例 #6
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
            return;
        }

        _instance = this;
        DontDestroyOnLoad(this.gameObject);
    }
コード例 #7
0
ファイル: SceneManager.cs プロジェクト: KrtzDev/Kusarigama
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

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

        DontDestroyOnLoad(gameObject);
    }
コード例 #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);
     }
 }
コード例 #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;
        }
    }
コード例 #10
0
 void loadScene()
 {
     Scenemanager.LoadScene()
 }
コード例 #11
0
 private void GoToMainMenu()
 {
     Scenemanager.Loadscene("MainMenu");
 }
コード例 #12
0
 private void GoToLoginMenu()
 {
     Scenemanager.Loadscene("LoginMenu");
 }
コード例 #13
0
 // Use this for initialization
 void Start()
 {
     scenemanager = FindObjectOfType <Scenemanager>();
     timetext     = GetComponent <Text>();
 }
コード例 #14
0
    void Awake()
    {
        instance = this;

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