private IEnumerator kurangEnergy()
    {
        string  url  = Link.url + "energy";
        WWWForm form = new WWWForm();

        form.AddField(Link.ID, PlayerPrefs.GetString(Link.ID));
        WWW www = new WWW(url, form);

        yield return(www);

        if (www.error == null)
        {
            var jsonString = JSON.Parse(www.text);
            Debug.Log(www.text);
            PlayerPrefs.SetString(Link.FOR_CONVERTING, jsonString["code"]);
            if (PlayerPrefs.GetString(Link.FOR_CONVERTING) == "0")
            {
                SceneManagerHelper.LoadScene(Link.PilihCharacter);
            }
        }
        else
        {
            Debug.Log("GAGAL");
        }
    }
Exemple #2
0
 public void OnBack()
 {
     if (savestates.GetComponent <Button>().interactable == true)
     {
         saving.SetActive(true);
     }
     else
     {
         SceneManagerHelper.LoadScene("Storage");
     }
 }
Exemple #3
0
    public void RequestPermission()
    {
        if (UniAndroidPermission.IsPermitted(AndroidPermission.ACCESS_FINE_LOCATION))
        {
            // text.text = "WRITE_EXTERNAL_STORAGE is already permitted!!";
            if (UniAndroidPermission.IsPermitted(AndroidPermission.CAMERA))
            {
                SceneManagerHelper.LoadScene("berburuhantu");

                // text.text = "CAMERA is already permitted!!";
                return;
            }
            UniAndroidPermission.RequestPermission(AndroidPermission.CAMERA, OnAllow2, OnDeny2, OnDenyAndNeverAskAgain2);
            return;
        }

        UniAndroidPermission.RequestPermission(AndroidPermission.ACCESS_FINE_LOCATION, OnAllow, OnDeny, OnDenyAndNeverAskAgain);
    }
Exemple #4
0
    // Update is called once per frame
    void Update()
    {
        if (PlayerPrefs.GetString("PLAY_TUTORIAL") == "FALSE")
        {
            if (Input.GetKey(KeyCode.Escape) && escape == false)
            {
                escape = true;
                if (Application.loadedLevelName == "Arena" && escape == true)
                {
                    SceneManagerHelper.LoadScene("Map");

                    escape = false;
                }
                else if (Application.loadedLevelName == "Searching" && escape == true)
                {
                    SceneManagerHelper.LoadScene("Arena");
                    escape = false;
                }
                else if (Application.loadedLevelName == "Game" && escape == true && PlayerPrefs.GetString(Link.JENIS) == "SINGLE")
                {
                    SceneManagerHelper.LoadScene("Map");
                    escape = false;
                }
                else if (Application.loadedLevelName == "Game" && escape == true && PlayerPrefs.GetString(Link.JENIS) == "MULTIPLE")
                {
                    SceneManagerHelper.LoadScene("Arena");
                    escape = false;
                }
                else
                {
                    if (GameObject.Find("LoadingScreen") != null)
                    {
                        GameObject.Find("LoadingScreen").GetComponent <SceneLoader> ().LoadingScreeen();
                    }
                    else
                    {
                        SceneManagerHelper.LoadScene("Home");
                        escape = false;
                    }
                }
            }
        }
    }
    public IEnumerator  AnimasiInformasiServer(string info)
    {
        isInfromasiServerPlay = true;
        informasiServer.SetActive(true);
        informasiServer.GetComponentInChildren <Text> ().text = info;
        informasiServer.GetComponent <Animator> ().Play("informasiServer");
        yield return(new WaitForSeconds(2));

        informasiServer.SetActive(false);
        isInfromasiServerPlay = false;
        informasiServer.GetComponentInChildren <Text> ().text = "";
        StopCoroutine(AnimasiInformasiServer(""));


        if (info == "Register Complete")
        {
            SceneManagerHelper.LoadScene("Home");
        }
    }
    IEnumerator onCoroutine()
    {
        while (true)
        {
            StartCoroutine(findMatch2());
            if (done)
            {
                time.text = (int.Parse(time.text) - 1).ToString();
                if (int.Parse(time.text) == 0 || int.Parse(time.text) <= 0 || int.Parse(time.text) < 0)
                {
                    PlayerPrefs.SetInt("GoRestart", 1);
                    SceneManagerHelper.LoadScene("Home");
                }
            }



            yield return(new WaitForSeconds(1f));
        }
    }
    private IEnumerator LoginOut()
    {
        string  url  = Link.url + "logout";
        WWWForm form = new WWWForm();

        form.AddField(Link.DEVICE_ID, PlayerPrefs.GetString(Link.DEVICE_ID));
        form.AddField(Link.EMAIL, PlayerPrefs.GetString(Link.EMAIL));
        form.AddField(Link.PASSWORD, PlayerPrefs.GetString(Link.PASSWORD));

        WWW www = new WWW(url, form);

        yield return(www);

        if (www.error == null)
        {
            var jsonString = JSON.Parse(www.text);
            PlayerPrefs.DeleteAll();
            //PlayerPrefs.DeleteKey(Link.STATUS_LOGIN);
            //PlayerPrefs.DeleteKey("SummonTutor");
            SceneManagerHelper.LoadScene(Link.Register);
            //PlayerPrefs.DeleteKey("tutorhitung");
            //PlayerPrefs.DeleteKey(Link.LOGIN_BY);
        }
    }
Exemple #8
0
    public void OnClick()
    {
        PlayerPrefs.SetString(Link.LOKASI, "hospital");
        PlayerPrefs.SetString(Link.USER_1, NamaText.text.ToString());
        PlayerPrefs.SetString(Link.USER_2, PlayerPrefs.GetString(Link.FULL_NAME));

        PlayerPrefs.SetString(Link.POS_1_CHAR_1_FILE, file1);
        PlayerPrefs.SetString(Link.POS_1_CHAR_2_FILE, file2);
        PlayerPrefs.SetString(Link.POS_1_CHAR_3_FILE, file3);

        PlayerPrefs.SetString(Link.POS_1_CHAR_1_ID, defense_id1);
        PlayerPrefs.SetString(Link.POS_1_CHAR_2_ID, defense_id2);
        PlayerPrefs.SetString(Link.POS_1_CHAR_3_ID, defense_id3);

        PlayerPrefs.SetString(Link.POS_1_CHAR_1_GRADE, defense_grade1);
        PlayerPrefs.SetString(Link.POS_1_CHAR_2_GRADE, defense_grade2);
        PlayerPrefs.SetString(Link.POS_1_CHAR_3_GRADE, defense_grade3);

        PlayerPrefs.SetString(Link.POS_1_CHAR_1_LEVEL, defense_level1);
        PlayerPrefs.SetString(Link.POS_1_CHAR_2_LEVEL, defense_level2);
        PlayerPrefs.SetString(Link.POS_1_CHAR_3_LEVEL, defense_level3);

        PlayerPrefs.SetString(Link.POS_1_CHAR_1_ATTACK, defense1_attack);
        PlayerPrefs.SetString(Link.POS_1_CHAR_2_ATTACK, defense2_attack);
        PlayerPrefs.SetString(Link.POS_1_CHAR_3_ATTACK, defense3_attack);

        PlayerPrefs.SetString(Link.POS_1_CHAR_1_DEFENSE, defense1_defense);
        PlayerPrefs.SetString(Link.POS_1_CHAR_2_DEFENSE, defense2_defense);
        PlayerPrefs.SetString(Link.POS_1_CHAR_3_DEFENSE, defense3_defense);

        PlayerPrefs.SetString(Link.POS_1_CHAR_1_HP, defense1_hp);
        PlayerPrefs.SetString(Link.POS_1_CHAR_2_HP, defense2_hp);
        PlayerPrefs.SetString(Link.POS_1_CHAR_3_HP, defense3_hp);

        SceneManagerHelper.LoadScene("PilihCharacterOB");
    }
Exemple #9
0
 public void OnBack()
 {
     SceneManagerHelper.LoadScene("Home");
 }
Exemple #10
0
 public void OnEquipmentClick()
 {
     PlayerPrefs.SetString(Link.FOR_CONVERTING, hantuPlayerId);
     PlayerPrefs.SetString(Link.FOR_CONVERTING_2, file);
     SceneManagerHelper.LoadScene("Equipment");
 }
Exemple #11
0
 public void LoadScene(string name)
 {
     SceneManagerHelper.LoadScene(name);
 }
Exemple #12
0
 public void EXPDISTRIBUTION()
 {
     SceneManagerHelper.LoadScene("EXPDis");
 }
Exemple #13
0
 public void OnFusionClick()
 {
     SceneManagerHelper.LoadScene(Link.Fusion);
 }
 public void OnBack()
 {
     SceneManagerHelper.LoadScene(Link.Home);
 }
    private IEnumerator findMatch2()
    {
        string  url  = Link.url + "cek_match";
        WWWForm form = new WWWForm();

        form.AddField("id_device", android_id);
        form.AddField("room_name", PlayerPrefs.GetString("RoomName"));
        WWW www = new WWW(url, form);

        yield return(www);

        if (www.error == null)
        {
            done = true;
            var jsonString = JSON.Parse(www.text);

            PlayerPrefs.SetInt("value", int.Parse(jsonString ["code"][0]["value"]));

            if (PlayerPrefs.GetInt("value") == 2)
            {
                Debug.Log("SDH 2");

                PlayerPrefs.SetString("id_device_make", jsonString ["code"][0]["id_device_make"]);
                PlayerPrefs.SetString("TheStatus", jsonString ["code"][0]["status"]);

                if (PlayerPrefs.GetString("id_device_make") == android_id)
                {
                    PlayerPrefs.SetInt("pos", 1);

                    if (PlayerPrefs.GetString("TheStatus") == "1")
                    {
                        if (stoped == false)
                        {
                            stoped = true;
                            StartCoroutine(GotoUpdate());
                        }
                    }
                    else
                    {
                        PlayerPrefs.SetString("id_device", android_id);
                        StartCoroutine(kurangEnergy());
                        //	Application.LoadLevel ("Pilih Character");
                    }
                }
                else
                {
                    PlayerPrefs.SetInt("pos", 0);

                    if (PlayerPrefs.GetString("TheStatus") == "1")
                    {
                    }
                    else
                    {
                        PlayerPrefs.SetString("id_device", android_id);
                        SceneManagerHelper.LoadScene("Pilih Character");
                    }
                }
            }
            else
            {
                Debug.Log("belum 2");
            }
        }
        else
        {
            Debug.Log("fail");
        }
    }
    private IEnumerator DQItemList()
    {
        string  url  = Link.url + "DQuest";
        WWWForm form = new WWWForm();

        form.AddField("MY_ID", PlayerPrefs.GetString(Link.ID));
        //form.AddField ("SHOP_JENIS", "SPECIAL");
        WWW www = new WWW(url, form);

        yield return(www);

        if (www.error == null)
        {
            Debug.Log(www.text);
            var jsonString = JSON.Parse(www.text);
            //PlayerPrefs.SetString (Link.FOR_CONVERTING, jsonString["ID_SHOP_SPECIAL"]);
            if (int.Parse(jsonString["code"]) == 1)
            {
                for (int x = 0; x < int.Parse(jsonString["count"]); x++)
                {
                    int lol    = 0;
                    var number = int.TryParse(jsonString["data"][x]["Quest_Done"], out lol);

                    if (number)
                    {
                        if (lol == 1)
                        {
                            string String = jsonString["data"][x]["Type"];
                            if (String == "Summon")
                            {
                                PlayerPrefs.SetString("SummonMissionStats", "FALSE");
                            }
                            if (String == "SingleMode")
                            {
                                PlayerPrefs.SetString("SoloMissionStats", "FALSE");
                            }
                            if (String == "Catch")
                            {
                                PlayerPrefs.SetString("CatchMissionStats", "FALSE");
                            }
                        }
                        else
                        {
                            string String = jsonString["data"][x]["Type"];
                            if (String == "Summon")
                            {
                                PlayerPrefs.SetString("SummonMissionStats", "TRUE");
                                PlayerPrefs.SetString("SummonMissionQD", jsonString["data"][x]["ID"]);
                            }
                            if (String == "SingleMode")
                            {
                                PlayerPrefs.SetString("SoloMissionStats", "TRUE");
                                PlayerPrefs.SetString("SoloMissionQD", jsonString["data"][x]["ID"]);
                            }
                            if (String == "Catch")
                            {
                                PlayerPrefs.SetString("CatchMissionStats", "TRUE");
                                PlayerPrefs.SetString("CatchMissionQD", jsonString["data"][x]["ID"]);
                            }
                        }
                        //     Debug.Log(PlayerPrefs.GetString("SoloMissionQD"));
                    }
                    else
                    {
                    }
                }
            }
            else
            {
                Debug.Log("NoMission");
            }
            yield return(new WaitForSeconds(1));

            SceneManagerHelper.LoadScene(Link.Home);
        }
        else
        {
            Debug.Log(www.text);
            Debug.Log("NoMission");
        }
    }
Exemple #17
0
 public void OnHuntingClick()
 {
     SceneManagerHelper.LoadScene("berburuhantu");
 }
Exemple #18
0
 public void Onclick(string index)
 {
     SceneManagerHelper.LoadScene(index);
 }
Exemple #19
0
 public void OnPracticeClick()
 {
     SceneManagerHelper.LoadScene(Link.Practice);
 }
Exemple #20
0
 public void OnBattleClick()
 {
     SceneManagerHelper.LoadScene(Link.Map);
 }
Exemple #21
0
 public void OnSummonnClick()
 {
     SceneManagerHelper.LoadScene(Link.Summon);
 }
 public void OnCancel()
 {
     SceneManagerHelper.LoadScene("Arena");
 }
Exemple #23
0
    IEnumerator tunggustage(string stage, float time)
    {
        yield return(new WaitForSeconds(time));

        SceneManagerHelper.LoadScene(stage);
    }
Exemple #24
0
 public void OnBack2()
 {
     SceneManagerHelper.LoadScene("Storage");
 }
Exemple #25
0
 public void OnStorageClick()
 {
     SceneManagerHelper.LoadScene(Link.Storage);
 }
Exemple #26
0
 public void LoadOffline(string index)
 {
     PlayerPrefs.SetString(Link.SEARCH_BATTLE, "SINGLE");
     SceneManagerHelper.LoadScene(index);
     PlayerPrefs.SetInt("change", 1);
 }
Exemple #27
0
    private void OnAllow2()
    {
        SceneManagerHelper.LoadScene("berburuhantu");

        // text.text = "CAMERA is permitted NOW!!";
    }