Esempio n. 1
0
    // CCU上限を超えた時に呼ばれるメソッド
    void OnPhotonMaxCccuReached()
    {
        Debug.Log("log : 同時接続人数が20人を超えました");
        switch (phase)
        {
        case PHASE.yetJoinedRoom:
        case PHASE.isWaiting:
            statusText.text    = "";
            networkImg.enabled = false;
            loadingImg.SetActive(false);
            backButton.SetActive(false);
            stopCanvas.SetActive(true);
            statusText1.text = "ネットワークに接続していません\n通信の安定した場所で再度プレイしてください";
            AudioSourceManager.PlaySE(4);
            AudioSourceManager.audioBGM.Stop();
            BackTitleCountdown3();
            break;

        case PHASE.isConnected:
        case PHASE.isReady:
        case PHASE.isPlaying:
            stopCanvas.SetActive(true);
            statusText1.text = "現在同時接続人数が上限を超えています\n時間を置いて再度プレイしてください";
            AudioSourceManager.PlaySE(4);
            AudioSourceManager.audioBGM.Stop();
            BackTitleCountdown3();
            break;

        case PHASE.isEnded:
            Debug.Log("log : すでに勝敗がついています");
            break;
        }
    }
Esempio n. 2
0
    public void OkButton()
    {
        errorText.SetActive(false);
        NCMBObject database = new NCMBObject("DataBase");
        string     id       = Guid.NewGuid().ToString();

        database["id"]        = id;
        database["name"]      = inputField.text;
        database["winCount"]  = 0;
        database["loseCount"] = 0;
        database.SaveAsync((NCMBException e) => {
            if (e == null)
            {
                PlayerPrefs.SetString("ID", id);
                PlayerPrefs.SetString("PlayerName", inputField.text);
                PlayerPrefs.SetInt("WinCount", 0);
                PlayerPrefs.SetInt("LoseCount", 0);
                PlayerPrefs.SetInt("FirstOpen", 1);
                Invoke("toTitle", 0.25f);
                AudioSourceManager.PlaySE(1);
            }
            else
            {
                errorText.SetActive(true);
                AudioSourceManager.PlaySE(4);
            }
        });
        GameObject.Find("OkButton").GetComponent <Animation>().Play();
    }
Esempio n. 3
0
 //ボタンを押したら再開
 public void ReStartGame()
 {
     Time.timeScale = 1;
     Invoke("ReStart", 0.25f);
     GameObject.Find("BackButton").GetComponent <Animation>().Play();
     AudioSourceManager.PlaySE(3);
 }
Esempio n. 4
0
 //ボタンを押したらタイトルシーンに遷移
 public void BackTitle()
 {
     Time.timeScale = 1;
     Invoke("toTitle", 0.25f);
     GameObject.Find("ReturnTitleButton").GetComponent <Animation>().Play();
     AudioSourceManager.PlaySE(3);
 }
Esempio n. 5
0
 //ボタンを押したらリザルトシーンに遷移
 public void GotoResult()
 {
     Invoke("toResult", 0.25f);
     GameObject.Find("NextButton").GetComponent <Animation>().Play();
     AudioSourceManager.PlaySE(2);
     AudioSourceManager.audioBGM.loop = true;
 }
Esempio n. 6
0
    public void SetScore()
    {
        nowLoadingCanvas.SetActive(true);
        AudioSourceManager.PlaySE(2);
        NCMBQuery <NCMBObject> query = new NCMBQuery <NCMBObject> ("DataBase");

        query.WhereEqualTo("id", id);
        query.FindAsync((List <NCMBObject> objList, NCMBException e) => {
            if (e == null)
            {
                // データベースを更新
                objList[0]["winCount"]  = newWinCount;
                objList[0]["loseCount"] = newLoseCount;
                objList[0].SaveAsync();
                PlayerPrefs.SetInt("WinCount", newWinCount);
                PlayerPrefs.SetInt("LoseCount", newLoseCount);
                nowLoadingCanvas.SetActive(false);
                finishLoadingCanvas.SetActive(true);
                AudioSourceManager.PlaySE(6);
            }
            else
            {
                // ネットワークに接続していない時
                nowLoadingCanvas.SetActive(false);
                failedLoadingCanvas.SetActive(true);
                AudioSourceManager.PlaySE(4);
            }
        });
    }
Esempio n. 7
0
    // リモートプレイヤーが退室した時に呼ばれるメソッド
    void OnPhotonPlayerDisconnected(PhotonPlayer otherPlayer)
    {
        Debug.Log("log : リモートプレイヤーが退室しました");
        switch (phase)
        {
        case PHASE.yetJoinedRoom:
        case PHASE.isWaiting:
            // まだ相手が接続していない段階なのでスルー
            break;

        case PHASE.isConnected:
        case PHASE.isReady:
        case PHASE.isPlaying:
            stopCanvas.SetActive(true);
            statusText1.text = "対戦相手との通信が切断されました";
            AudioSourceManager.PlaySE(4);
            AudioSourceManager.audioBGM.Stop();
            BackTitleCountdown3();
            break;

        case PHASE.isEnded:
            Debug.Log("log : すでに勝敗がついています");
            break;
        }
    }
Esempio n. 8
0
    public void FinisyEditNameButton()
    {
        errorText.SetActive(false);
        NCMBQuery <NCMBObject> query = new NCMBQuery <NCMBObject> ("DataBase");

        query.WhereEqualTo("id", id);
        query.FindAsync((List <NCMBObject> objList, NCMBException e) => {
            if (e == null)   // データの検索が成功したら、
            {
                objList[0]["name"] = inputField.text;
                objList[0].SaveAsync((NCMBException e2) => {
                    if (e2 == null)
                    {
                        GetRanking();
                    }
                });
                playerName    = inputField.text;
                nameText.text = playerName;
                PlayerPrefs.SetString("PlayerName", playerName);
                inputCanvas.enabled = false;
                AudioSourceManager.PlaySE(1);
            }
            else
            {
                errorText.SetActive(true);
                AudioSourceManager.PlaySE(4);
            }
        });
    }
Esempio n. 9
0
 void GraphMoveStart()
 {
     showWinPercent          = winPercent;
     percentGraoh.fillAmount = (float)showWinPercent;
     percentText.text        = (showWinPercent * 100).ToString("f1") + "%";
     AudioSourceManager.PlaySE(7);
     graphMoving = 1;
 }
Esempio n. 10
0
 //ボタンを押したら一時停止
 public void StopGame()
 {
     isPlaying      = false;
     Time.timeScale = 0;
     AudioSourceManager.PlaySE(4);
     AudioSourceManager.audioBGM.Pause();
     stopCanvas.SetActive(true);
 }
Esempio n. 11
0
 public void StopGame()
 {
     phase = PHASE.other;
     PhotonNetwork.Disconnect();
     stopCanvas.SetActive(true);
     AudioSourceManager.PlaySE(4);
     AudioSourceManager.audioBGM.Stop();
     statusText1.text = "オンライン対戦を中断しました";
     BackTitleCountdown3();
 }
Esempio n. 12
0
 //ボタンを押したらタイトルシーンに遷移
 public void GotoTitle()
 {
     phase = PHASE.other;
     PhotonNetwork.room.IsVisible = false;
     PhotonNetwork.room.IsOpen    = false;
     AudioSourceManager.PlaySE(3);
     PhotonNetwork.LeaveRoom();
     PhotonNetwork.LeaveLobby();
     BackTitle();
 }
Esempio n. 13
0
 //ボタンを押したらルームを出てリザルトシーンに遷移
 public void GotoResult()
 {
     PhotonNetwork.LeaveRoom();
     PhotonNetwork.LeaveLobby();
     PhotonNetwork.Disconnect();
     Invoke("toResult", 0.25f);
     AudioSourceManager.PlaySE(2);
     GameObject.Find("NextButton").GetComponent <Animation>().Play();
     AudioSourceManager.audioBGM.loop = true;
 }
Esempio n. 14
0
 public void EyePrevButton()
 {
     if (eyeColor == 0)
     {
         eyeColor = 6;
     }
     else
     {
         eyeColor--;
     }
     SetEyeColor();
     AudioSourceManager.PlaySE(2);
 }
Esempio n. 15
0
 public void CostumeColorNextButton()
 {
     if (costumeColor == COSTUME_MAX - 1)
     {
         costumeColor = 0;
     }
     else
     {
         costumeColor++;
     }
     SetCostumeColor();
     AudioSourceManager.PlaySE(2);
 }
Esempio n. 16
0
 public void CostumeColorPrevButton()
 {
     if (costumeColor == 0)
     {
         costumeColor = 6;
     }
     else
     {
         costumeColor--;
     }
     SetCostumeColor();
     AudioSourceManager.PlaySE(2);
 }
Esempio n. 17
0
 public void EyeNextButton()
 {
     if (eyeColor == EYECOLOR_MAX - 1)
     {
         eyeColor = 0;
     }
     else
     {
         eyeColor++;
     }
     SetEyeColor();
     AudioSourceManager.PlaySE(2);
 }
Esempio n. 18
0
 public void HairPrevButton()
 {
     if (hairColor == 0)
     {
         hairColor = 6;
     }
     else
     {
         hairColor--;
     }
     SetHairColor();
     AudioSourceManager.PlaySE(2);
 }
Esempio n. 19
0
 public void HairNextButton()
 {
     if (hairColor == HAIRCOLOR_MAX - 1)
     {
         hairColor = 0;
     }
     else
     {
         hairColor++;
     }
     SetHairColor();
     AudioSourceManager.PlaySE(2);
 }
Esempio n. 20
0
 public void SettingButton()
 {
     AudioSourceManager.PlaySE(2);
     if (isOpen)
     {
         howToPlayCanvasAnim.SetTrigger("Close");
         howToPlayButtonCanvasAnim.SetTrigger("Close");
     }
     else
     {
         howToPlayCanvasAnim.SetTrigger("Open");
         howToPlayButtonCanvasAnim.SetTrigger("Open");
     }
 }
Esempio n. 21
0
 public void CharaNextButton()
 {
     if (chara == CHARA_MAX - 1)
     {
         chara = 0;
     }
     else
     {
         chara++;
     }
     SetChara();
     SetHairColor();
     SetEyeColor();
     SetCostumeColor();
     AudioSourceManager.PlaySE(2);
 }
Esempio n. 22
0
 public void CharaPrevButton()
 {
     if (chara == 0)
     {
         chara = 6;
     }
     else
     {
         chara--;
     }
     SetChara();
     SetHairColor();
     SetEyeColor();
     SetCostumeColor();
     AudioSourceManager.PlaySE(2);
 }
Esempio n. 23
0
    // Photonとの接続が切断された時に呼ばれるメソッド
    void OnDisconnectedFromPhoton()
    {
        Debug.Log("log : ネットワークに接続していません");
        switch (phase)
        {
        case PHASE.yetJoinedRoom:
        case PHASE.isWaiting:
            statusText.text    = "";
            networkImg.enabled = false;
            loadingImg.SetActive(false);
            backButton.SetActive(false);
            stopCanvas.SetActive(true);
            statusText1.text = "ネットワークに接続していません\n通信の安定した場所で再度プレイしてください";
            AudioSourceManager.PlaySE(4);
            AudioSourceManager.audioBGM.Stop();
            BackTitleCountdown3();
            break;

        case PHASE.isConnected:
        case PHASE.isReady:
        case PHASE.isPlaying:
            stopCanvas.SetActive(true);
            statusText1.text = "ネットワークに接続していません\n通信の安定した場所で再度プレイしてください";
            AudioSourceManager.PlaySE(4);
            AudioSourceManager.audioBGM.Stop();
            BackTitleCountdown3();
            break;

        case PHASE.isEnded:
            Debug.Log("log : すでに勝敗がついています");
            break;

        case PHASE.other:
            Debug.Log("log : タイトルに戻る時の接続遮断");
            break;
        }
    }
Esempio n. 24
0
 public void toSelectCostumeButton()
 {
     Invoke("toSelectCostume", 0.25f);
     GameObject.Find("SelectCostumeButtonFrame").GetComponent <Animation>().Play();
     AudioSourceManager.PlaySE(0);
 }
Esempio n. 25
0
 public void BackButton()
 {
     SceneManager.LoadScene("Title");
     AudioSourceManager.PlaySE(3);
 }
Esempio n. 26
0
 public void toMatchingButton()
 {
     Invoke("toMatching", 0.25f);
     GameObject.Find("StartButtonFrame").GetComponent <Animation>().Play();
     AudioSourceManager.PlaySE(0);
 }
Esempio n. 27
0
 public void toOfflinePlayButton()
 {
     Invoke("toOfflinePlay", 0.25f);
     GameObject.Find("OfflineStartButtonFrame").GetComponent <Animation>().Play();
     AudioSourceManager.PlaySE(0);
 }
Esempio n. 28
0
 public void toRecordButton()
 {
     Invoke("toRecord", 0.25f);
     GameObject.Find("RankingButtonFrame").GetComponent <Animation>().Play();
     AudioSourceManager.PlaySE(0);
 }
Esempio n. 29
0
 public void NextButton()
 {
     AudioSourceManager.PlaySE(2);
     num++;
 }
Esempio n. 30
0
 public void PrevButton()
 {
     AudioSourceManager.PlaySE(2);
     num--;
 }