Exemplo n.º 1
0
    /// <summary>
    /// 开始游戏
    /// </summary>
    void StartGame()
    {
        GameAudio.instance.PlayAudioSourceUI("click_btn");
        if (playerPos.childCount > 1)
        {
            bool enableStart = true;
            for (int i = 0; i < room.member.Count; i++)
            {
                Debug.Log("成员状态:" + room.member[i].IsInWaitRoom);
                if (room.member[i].IsInWaitRoom == false)
                {
                    enableStart = false;
                    Label.CreatLabel(Label.Standard, labelPos, Vector3.zero, room.member[i].name + "玩家没有退出战斗不能开启游戏", Color.white, null);
                    break;
                }
            }

            if (enableStart)
            {
                GameCommand.Begin(NetStart.myInfo.roomNum);
            }
        }
        else
        {
            Label.CreatLabel(Label.Standard, labelPos, Vector3.zero, "开始游戏满足条件:房间人数 2-4人", Color.white, null);
        }
    }