Exemplo n.º 1
0
    public void reStratGame()
    {
        if (GlobalDataScript.isOverByPlayer)
        {
            //TipsManagerScript.getInstance ().setTips ("房间已解散,不能重新开始游戏");
            closeDialog();
            return;
        }

        if (GlobalDataScript.surplusTimes > 0)
        {
            if (GlobalDataScript.roomVo.gameType == 0)
            {
                CustomSocket.getInstance().sendMsg(new GameReadyRequest());
                CommonEvent.getInstance().readyGame();
            }
            closeDialog();
        }
        else
        {
            //TipsManagerScript.getInstance ().setTips ("游戏局数已经用完,无法重新开始游戏");
            closeDialog();
        }
        SoundCtrl.getInstance().playSoundByActionButton(1);
    }
Exemplo n.º 2
0
    public void openFinalOverPanl()
    {
        SoundCtrl.getInstance().playSoundUI();
        if (GlobalDataScript.finalGameEndVo != null && GlobalDataScript.finalGameEndVo.totalInfo != null && GlobalDataScript.finalGameEndVo.totalInfo.Count > 0)
        {
            GameObject obj = PrefabManage.loadPerfab("prefab/Panel_Game_Over");
            obj.GetComponent <GameOverScript>().setDisplaContent(1, GlobalDataScript.roomAvatarVoList);
            obj.transform.SetSiblingIndex(2);

            if (GlobalDataScript.singalGameOverList.Count > 0)
            {
                for (int i = 0; i < GlobalDataScript.singalGameOverList.Count; i++)
                {
                    //GlobalDataScript.singalGameOverList [i].GetComponent<GameOverScript> ().closeDialog ();
                    Destroy(GlobalDataScript.singalGameOverList [i].GetComponent <GameOverScript>());
                    Destroy(GlobalDataScript.singalGameOverList [i]);
                }
                //int count = GlobalDataScript.singalGameOverList.Count;
                //for (int i = 0; i < count; i++) {
                //	GlobalDataScript.singalGameOverList.RemoveAt (0);
                //}
                GlobalDataScript.singalGameOverList.Clear();
            }
            if (CommonEvent.getInstance().closeGamePanel != null)
            {
                CommonEvent.getInstance().closeGamePanel();
            }
        }
    }
Exemplo n.º 3
0
 public void removeListener()
 {
     SocketEventHandle.getInstance().cardChangeNotice    -= cardChangeNotice;
     CommonEvent.getInstance().DisplayBroadcast          -= gameBroadcastNotice;
     SocketEventHandle.getInstance().contactInfoResponse -= contactInfoResponse;
     //	SocketEventHandle.getInstance ().gameBroadcastNotice -= gameBroadcastNotice;
 }
Exemplo n.º 4
0
 void Start()
 {
     SocketEventHandle.getInstance().giftResponse += giftResponse;
     CommonEvent.getInstance().prizeCountChange   += prizeCountChange;
     CustomSocket.getInstance().sendMsg(new GetGiftRequest("0"));
     choujiangNum.text = GlobalDataScript.loginResponseData.account.prizecount + "";
 }
Exemplo n.º 5
0
    //增加服务器返沪数据监听
    public void addListener()
    {
        SocketEventHandle.getInstance().RoomBackResponse    += RoomBackResponse;
        SocketEventHandle.getInstance().cardChangeNotice    += cardChangeNotice;
        SocketEventHandle.getInstance().contactInfoResponse += contactInfoResponse;

        //	SocketEventHandle.getInstance ().gameBroadcastNotice += gameBroadcastNotice;
        CommonEvent.getInstance().DisplayBroadcast += gameBroadcastNotice;
    }
Exemplo n.º 6
0
 public void removeListener()
 {
     SocketEventHandle.getInstance().cardChangeNotice    -= cardChangeNotice;
     CommonEvent.getInstance().DisplayBroadcast          -= gameBroadcastNotice;
     SocketEventHandle.getInstance().contactInfoResponse -= contactInfoResponse;
     //	SocketEventHandle.getInstance ().gameBroadcastNotice -= gameBroadcastNotice;
     //SocketEventHandle.getInstance().otherUserJointRoomCallBack -= otherUserJointRoom;
     SocketEventHandle.getInstance().StartPrepareGameCallBack -= StartPrepareGame;
 }
Exemplo n.º 7
0
    private void hostUpdateDrawResponse(ClientResponse response)
    {
        int giftTimes = int.Parse(response.message);

        GlobalDataScript.loginResponseData.account.prizecount = giftTimes;
        if (CommonEvent.getInstance().prizeCountChange != null)
        {
            CommonEvent.getInstance().prizeCountChange();
        }
    }
Exemplo n.º 8
0
    public void openFinalOverPanl()
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        MyDebug.Log("------------------0----------------------");

        MyDebug.Log("-----------------GlobalDataScript.finalGameEndVo.totalInfo.Count---------------------" + GlobalDataScript.finalGameEndVo != null);

        MyDebug.Log("-----------------GlobalDataScript.finalGameEndVo.totalInfo.Count---------------------" + GlobalDataScript.finalGameEndVo.totalInfo != null);

        MyDebug.Log("-----------------GlobalDataScript.finalGameEndVo.totalInfo.Count---------------------" + GlobalDataScript.finalGameEndVo.totalInfo.Count);
        MyDebug.Log("------------------GlobalDataScript.finalGameEndVo.totalInfo !=null----------------------" + GlobalDataScript.finalGameEndVo.totalInfo != null);

        MyDebug.Log("-----------------GlobalDataScript.finalGameEndVo !=null--------------------" + GlobalDataScript.finalGameEndVo != null);
        if (GlobalDataScript.finalGameEndVo != null && GlobalDataScript.finalGameEndVo.totalInfo != null && GlobalDataScript.finalGameEndVo.totalInfo.Count > 0)
        {
            MyDebug.Log("------------------1----------------------");
            GameObject obj = PrefabManage.loadPerfab("prefab/Panel_Game_Over");

            if (GlobalDataScript.roomVo.gameType == 0)
            {
                obj.GetComponent <GameOverScript> ().setDisplayContent(1,
                                                                       GlobalDataScript.roomAvatarVoList, null, GlobalDataScript.hupaiResponseVo.validMas);
            }
            else
            {
                obj.GetComponent <GameOverScript> ().setDisplayContent_pdk(1,
                                                                           GlobalDataScript.roomAvatarVoList, null, GlobalDataScript.hupaiResponseVo.validMas);
            }
            obj.transform.SetSiblingIndex(2);
            MyDebug.Log("------------------2----------------------");
            if (GlobalDataScript.singalGameOverList.Count > 0)
            {
                MyDebug.Log("------------------3----------------------");
                for (int i = 0; i < GlobalDataScript.singalGameOverList.Count; i++)
                {
                    //GlobalDataScript.singalGameOverList [i].GetComponent<GameOverScript> ().closeDialog ();
                    Destroy(GlobalDataScript.singalGameOverList[i].GetComponent <GameOverScript>());
                    Destroy(GlobalDataScript.singalGameOverList[i]);
                }
                MyDebug.Log("------------------4----------------------");
                //int count = GlobalDataScript.singalGameOverList.Count;
                //for (int i = 0; i < count; i++) {
                //	GlobalDataScript.singalGameOverList.RemoveAt (0);
                //}
                GlobalDataScript.singalGameOverList.Clear();
            }
            MyDebug.Log("------------------5----------------------");
            if (CommonEvent.getInstance().closeGamePanel != null)
            {
                CommonEvent.getInstance().closeGamePanel();
            }
        }
    }
Exemplo n.º 9
0
 // Use this for initialization
 void Start()
 {
     // initUI();
     initUserInfoUI();
     GlobalDataScript.isonLoginPage = false;
     checkEnterInRoom();
     addListener();
     if (CommonEvent.getInstance().DisplayBroadcast != null)
     {
         CommonEvent.getInstance().DisplayBroadcast();
     }
 }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        initUI();
        GlobalDataScript.isonLoginPage = false;
        checkEnterInRoom();
        addListener();
        if (CommonEvent.getInstance().DisplayBroadcast != null)
        {
            CommonEvent.getInstance().DisplayBroadcast();
        }

        staticc__ChoiceR_api choose = new staticc__ChoiceR_api();

        choose.rtype = ApiCode.CODE_ZERO;
        CustomSocket.getInstance().sendMsg(new ClientRequest(ApiCode.ChooseGameRequest).
                                           SetContent <staticc__ChoiceR_api>(choose));
    }
Exemplo n.º 11
0
    private void gameBroadcastNotice(ClientResponse response)
    {
        string noticeString = response.message;

        string[] noticeList = noticeString.Split('*');
        //	List<string> notices = new List<string> ();
        if (noticeList != null)
        {
            GlobalDataScript.noticeMegs = new List <string> ();
            for (int i = 0; i < noticeList.Length; i++)
            {
                GlobalDataScript.noticeMegs.Add(noticeList[i]);
            }
            if (CommonEvent.getInstance().DisplayBroadcast != null)
            {
                CommonEvent.getInstance().DisplayBroadcast();
            }
        }
    }
Exemplo n.º 12
0
    public void reStratGame()
    {
        if (GlobalDataScript.isOverByPlayer)
        {
            TipsManagerScript.getInstance().setTips("房间已解散,不能重新开始游戏");
            return;
        }

        if (GlobalDataScript.surplusTimes > 0)
        {
            CustomSocket.getInstance().sendMsg(new GameReadyRequest());
            CommonEvent.getInstance().readyGame();
            closeDialog();
        }
        else
        {
            TipsManagerScript.getInstance().setTips("游戏局数已经用完,无法重新开始游戏");
        }
    }
Exemplo n.º 13
0
    public void reStratGame()
    {
        SoundCtrl.getInstance().playSoundUI();
        if (GlobalDataScript.isOverByPlayer)
        {
            TipsManagerScript.getInstance().setTips("房间已解散,不能重新开始游戏");
            return;
        }

        if (GlobalDataScript.surplusTimes > 0 && GlobalDataScript.gameOver == false)
        {
            CustomSocket.getInstance().sendMsg(new GameReadyRequest());
            CommonEvent.getInstance().readyGame();
            closeDialog();
        }
        else
        {
            TipsManagerScript.getInstance().setTips("游戏已经结束,无法重新开始游戏");
        }
    }
Exemplo n.º 14
0
    private void finalGameOver()
    {
        loadPerfab("prefab/Panel_Game_Over", 1);


        //	GlobalDataScript.singalGameOver.GetComponent<GameOverScript> ().closeDialog ();

        if (GlobalDataScript.singalGameOverList.Count > 0)
        {
            for (int i = 0; i < GlobalDataScript.singalGameOverList.Count; i++)
            {
                //GlobalDataScript.singalGameOverList [i].GetComponent<GameOverScript> ().closeDialog ();
                Destroy(GlobalDataScript.singalGameOverList[i].GetComponent <GameOverScript>());
                Destroy(GlobalDataScript.singalGameOverList[i]);
            }
            //int count = GlobalDataScript.singalGameOverList.Count;
            //for (int i = 0; i < count; i++) {
            //	GlobalDataScript.singalGameOverList.RemoveAt (0);
            //}
            GlobalDataScript.singalGameOverList.Clear();
        }

        CommonEvent.getInstance().closeGamePanel();
    }
Exemplo n.º 15
0
    private void setFinalContent_DN()
    {
        GlobalDataScript.finalGameEndVo.totalInfo [0].setIsWiner(true);
        GlobalDataScript.finalGameEndVo.totalInfo [0].setIsPaoshou(true);
        int topScore   = GlobalDataScript.finalGameEndVo.totalInfo [0].scores;
        int topPaoshou = GlobalDataScript.finalGameEndVo.totalInfo[0].dianpao;

        int uuid0    = GlobalDataScript.finalGameEndVo.totalInfo [0].uuid;
        int owerUuid = GlobalDataScript.finalGameEndVo.theowner;

        Account account0 = getAcount(uuid0);

        //AvatarVO avatarVO0 = getAvatar (uuid0);

        string iconstr  = account0.headicon;
        string nickName = account0.nickname;

        GlobalDataScript.finalGameEndVo.totalInfo [0].setIcon(iconstr);
        GlobalDataScript.finalGameEndVo.totalInfo [0].setNickname(nickName);
        if (owerUuid == uuid0)
        {
            GlobalDataScript.finalGameEndVo.totalInfo [0].setIsMain(true);
        }
        else
        {
            GlobalDataScript.finalGameEndVo.totalInfo [0].setIsMain(false);
        }
        //	GlobalDataScript.finalGameEndVo.totalInfo [0].setIsMain (avatarVO0.main);
        int lastTopIndex     = 0;
        int lastPaoshouIndex = 0;

        if (GlobalDataScript.finalGameEndVo != null && GlobalDataScript.finalGameEndVo.totalInfo.Count > 0)
        {
            for (int i = 1; i < GlobalDataScript.finalGameEndVo.totalInfo.Count; i++)
            {
                if (topScore < GlobalDataScript.finalGameEndVo.totalInfo [i].scores)
                {
                    GlobalDataScript.finalGameEndVo.totalInfo [lastTopIndex].setIsWiner(false);
                    GlobalDataScript.finalGameEndVo.totalInfo [i].setIsWiner(true);
                    lastTopIndex = i;
                    topScore     = GlobalDataScript.finalGameEndVo.totalInfo[i].scores;
                }
                if (topPaoshou < GlobalDataScript.finalGameEndVo.totalInfo [i].dianpao && !GlobalDataScript.finalGameEndVo.totalInfo [i].getIsWiner())
                {
                    topPaoshou = GlobalDataScript.finalGameEndVo.totalInfo[i].dianpao;
                    GlobalDataScript.finalGameEndVo.totalInfo [i].setIsPaoshou(true);
                    GlobalDataScript.finalGameEndVo.totalInfo [lastPaoshouIndex].setIsPaoshou(false);
                    lastPaoshouIndex = i;
                }


                int     uuid    = GlobalDataScript.finalGameEndVo.totalInfo [i].uuid;
                Account account = getAcount(uuid);
                if (account != null)
                {
                    GlobalDataScript.finalGameEndVo.totalInfo [i].setIcon(account.headicon);
                    GlobalDataScript.finalGameEndVo.totalInfo [i].setNickname(account.nickname);
                }
                if (owerUuid == uuid)
                {
                    GlobalDataScript.finalGameEndVo.totalInfo [i].setIsMain(true);
                }
                else
                {
                    GlobalDataScript.finalGameEndVo.totalInfo [i].setIsMain(false);
                }
            }

            for (int i = 0; i < GlobalDataScript.finalGameEndVo.totalInfo.Count; i++)
            {
                FinalGameEndItemVo itemdata = GlobalDataScript.finalGameEndVo.totalInfo [i];
                GameObject         itemTemp = Instantiate(Resources.Load("Prefab/Panel_DN_Final_Item")) as GameObject;
                itemTemp.transform.parent     = signalEndPanel_dn.transform;
                itemTemp.transform.localScale = Vector3.one;                //  new Vector3 (0.8f,0.8f,0.8f)
                itemTemp.GetComponent <DNFinalOverScript>().setUI_DN_final(itemdata);
            }
            if (CommonEvent.getInstance().closeGamePanel != null)
            {
                CommonEvent.getInstance().closeGamePanel();
            }
        }
    }