示例#1
0
    void InitialGameUI()
    {
        //初次進入進行遊戲畫面初始化

        btn_hintLA = this.GameStartUI.GetComponentsInChildren <Button>()[0];
        btn_hintST = this.GameStartUI.GetComponentsInChildren <Button>()[1];
        //提示按鈕監聽事件
        btn_hintLA.onClick.AddListener(ListenAgain);
        btn_hintST.onClick.AddListener(ShowTranslation);

        for (int i = 0; i < PhotonNetwork.room.PlayerCount; i++)
        {
            PhotonPlayer local = PhotonNetwork.player;
            PhotonNetwork.playerList[i].SetScore(0);//重置玩家分數
            LocalPlayerText.text = local.GetScore().ToString("D2");
            player = PhotonNetwork.playerList;
            //player[i].SetScore(0);

            Text       remote   = Instantiate(RemotePlayerText);
            GameObject GameRank = GameObject.FindGameObjectWithTag("GameRank");
            remote.transform.SetParent(GameRank.transform);
            remote.transform.localPosition = new Vector3(28, -i * 80 + 140, 0);
            remote.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
            remote.name = (i + 1) + "";
            remote.text = player[i].NickName + " " + player[i].GetScore().ToString("D2") + "分";
        }
        xmlprocess.createCompeteRecord();
        xmlprocess.ScceneHistoryRecord("StartCompete", DateTime.Now.ToString("HH:mm:ss"));
    }