Ejemplo n.º 1
0
    public override void EnterState()
    {
        m_startUI = GameStart.GetInstance().UIModuel.LoadResUI <GameStartUI>("StartUI");
        GameAudioModuel moduel = GameStart.GetInstance().AudioModuel;

        moduel.PlayBgAudio("BGM_001");
    }
Ejemplo n.º 2
0
    void RefreshConnectUI()
    {
        this.ConnectUiView.SetActive(!PhotonNetwork.inRoom);//如果還沒進房間則顯示連線畫面

        this.WaitingUI.SetActive(PhotonNetwork.inRoom);
        if (GameStartUI.GetActive())
        {
            this.GameStartUI.SetActive(false);
        }
    }
Ejemplo n.º 3
0
    IEnumerator showResult()                                                         //總排名
    {
        GameObject[] PlayerLists = GameObject.FindGameObjectsWithTag("PlayerLists"); //抓取玩家名單的物件,方便銷毀
        GameStartUI.SetActive(false);
        ResultUIView.SetActive(true);
        PhotonPlayer local     = PhotonNetwork.player;
        int          localRank = 0;

        for (int i = 0; i < PhotonNetwork.room.PlayerCount; i++)
        {
            if (player[i].NickName == local.NickName)
            {
                localRank = i + 1;
            }
            ResultUIView.GetComponentsInChildren <Text>()[0].text += player[i].NickName + " 分數:" + player[i].GetScore().ToString("D2") + "\n\n";
        }
        ResultUIView.GetComponentsInChildren <Text>()[1].text = c_hintLA_count.ToString();
        ResultUIView.GetComponentsInChildren <Text>()[2].text = c_hintST_count.ToString();
        Button btn_learn = ResultUIView.GetComponentsInChildren <Button>()[0];
        Button btn_play  = ResultUIView.GetComponentsInChildren <Button>()[1];
        Button btn_exit  = ResultUIView.GetComponentsInChildren <Button>()[2];

        btn_learn.onClick.AddListener(delegate() { gameover(0, PlayerLists); });
        btn_play.onClick.AddListener(delegate() { gameover(1, PlayerLists); });
        btn_exit.onClick.AddListener(delegate() { gameover(2, PlayerLists); });
        yield return(new WaitForSeconds(0.1f));

        achievementState[1] = xmlprocess.setCompeteCount();//對戰次數
        if (xmlprocess.setCompeteCorrectRecord(correctNum, wrongNum) != null)
        {
            achievementState[2] = xmlprocess.setCompeteCorrectRecord(correctNum, wrongNum);                                                                  //累積答對
        }
        if (xmlprocess.setCompeteMaxCorrectRecord(max_correctNum) != null)
        {
            achievementState[3] = xmlprocess.setCompeteMaxCorrectRecord(max_correctNum);                                  //連續答對
        }
        string[] s_state = xmlprocess.setCompeteScoreRecord(c_hintLA_count, c_hintST_count, local.GetScore(), localRank); //提示與分數排名
        if (s_state[0] != null)
        {
            achievementState[4] = s_state[0];                    //有進步
        }
        if (s_state[1] != null)
        {
            achievementState[5] = s_state[1];                    //有刷新分數
        }
        if (s_state[2] != null)
        {
            achievementState[6] = s_state[2];                    //有進榜
        }
    }