Пример #1
0
 public void sendMsg()
 {
     if (msg.text.Length == 0)
     {
         return;
     }
     SoundCtrl.getInstance().playSoundByActionButton(1);
     CustomSocket.getInstance().sendMsg(new MessageBoxRequest(2, msg.text, GlobalDataScript.loginResponseData.account.uuid));
     if (GlobalDataScript.roomVo.gameType == 0)
     {
         if (myMaj == null)
         {
             myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript> ();
         }
         if (myMaj != null)
         {
             myMaj.playerItems [0].showChatMessage(msg.text);
         }
     }
     else if (GlobalDataScript.roomVo.gameType == 1)
     {
         if (myPdk == null)
         {
             myPdk = GameObject.Find("Panel_GamePDK(Clone)").GetComponent <MyPDKScript> ();
         }
         if (myPdk != null)
         {
             myPdk.playerItems [0].showChatMessage(msg.text);
         }
     }
     else if (GlobalDataScript.roomVo.gameType == 3)
     {
         if (myDN == null && GlobalDataScript.roomVo.playerAmounts == 10)
         {
             myDN = GameObject.Find("Panel_GameDN(Clone)").GetComponent <MyDNScript> ();
         }
         if (myDN == null && GlobalDataScript.roomVo.playerAmounts == 6)
         {
             myDN = GameObject.Find("Panel_GameDN_6(Clone)").GetComponent <MyDNScript>();
         }
         if (myDN != null)
         {
             myDN.playerItems [0].showChatMessage(msg.text);
         }
     }
     else if (GlobalDataScript.roomVo.gameType == 4)
     {
         if (myDzpk == null)
         {
             myDzpk = GameObject.Find("Panel_GameDZPK(Clone)").GetComponent <MyDZPKScript> ();
         }
         if (myDzpk != null)
         {
             myDzpk.playerItems [0].showChatMessage(msg.text);
         }
     }
     hidePanel();
 }
Пример #2
0
    public void btnClick(int index)
    {
        SoundCtrl.getInstance().playMessageBoxSound(index, GlobalDataScript.loginResponseData.account.sex, 3);
        CustomSocket.getInstance().sendMsg(new MessageBoxRequest(1, GlobalDataScript.loginResponseData.account.sex == 1 ? (index + 1000).ToString(): (index + 3000).ToString(), GlobalDataScript.loginResponseData.account.uuid));
        if (GlobalDataScript.roomVo.gameType == 0)
        {
            if (myMaj == null)
            {
                myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript> ();
            }
            if (myMaj != null)
            {
                myMaj.playerItems [0].showChatMessage(index);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 1)
        {
            if (myPdk == null)
            {
                myPdk = GameObject.Find("Panel_GamePDK(Clone)").GetComponent <MyPDKScript> ();
            }
            if (myPdk != null)
            {
                myPdk.playerItems [0].showChatMessage(index);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 3)
        {
            if (myDN == null && GlobalDataScript.roomVo.playerAmounts == 10)
            {
                myDN = GameObject.Find("Panel_GameDN(Clone)").GetComponent <MyDNScript> ();
            }
            if (myDN == null && GlobalDataScript.roomVo.playerAmounts == 6)
            {
                myDN = GameObject.Find("Panel_GameDN_6(Clone)").GetComponent <MyDNScript>();
            }
            if (myDN != null)
            {
                myDN.playerItems [0].showChatMessage(index);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 4)
        {
            if (myDzpk == null)
            {
                myDzpk = GameObject.Find("Panel_GameDZPK(Clone)").GetComponent <MyDZPKScript> ();
            }
            if (myDzpk != null)
            {
                myDzpk.playerItems [0].showChatMessage(index);
            }
        }

        hidePanel();
    }
Пример #3
0
    public void sendBiaoQing(string indexStr)
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        int    sex = GlobalDataScript.loginResponseData.account.sex;
        string tmp = null;

        if (sex == 1)
        {
            tmp = "" + (1000 + int.Parse(indexStr));
        }
        else
        {
            tmp = "" + (3000 + int.Parse(indexStr));
        }
        CustomSocket.getInstance().sendMsg(new MessageBoxRequest(3, tmp, GlobalDataScript.loginResponseData.account.uuid));
        if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.NULL)
        {
            if (myMaj == null)
            {
                myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript> ();
            }
            if (myMaj != null)
            {
                int index = int.Parse(indexStr) - 1;

                //SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myMaj.playerItems [0].showBiaoQing(myMaj.getBqScript().getBiaoqing(index));
            }
        }
        else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.PDK)
        {
            if (myPdk == null)
            {
                myPdk = GameObject.Find("Panel_GamePDK(Clone)").GetComponent <MyPDKScript> ();
            }
            if (myPdk != null)
            {
                int index = int.Parse(indexStr) - 1;

                //SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myPdk.playerItems [0].showBiaoQing(myPdk.getBqScript().getBiaoqing(index));
            }
        }
        else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.DN)
        {
            if (myDN == null)
            {
                myDN = GameObject.Find("Panel_GameDN(Clone)").GetComponent <MyDNScript> ();
            }
            if (myDN != null)
            {
                int index = int.Parse(indexStr) - 1;
//				if(!(GlobalDataScript.roomVo.gameType == 3))
//					SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myDN.playerItems [0].showBiaoQing(myDN.getBqScript().getBiaoqing(index));
            }
        }
        else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.DZPK)
        {
            if (myDzpk == null)
            {
                myDzpk = GameObject.Find("Panel_GameDZPK(Clone)").GetComponent <MyDZPKScript> ();
            }
            if (myDzpk != null)
            {
                int index = int.Parse(indexStr) - 1;
                //
                //SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myDzpk.playerItems [0].showBiaoQing(myDzpk.getBqScript().getBiaoqing(index));
            }
        }
        else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.AMH)
        {
            if (myAmh == null)
            {
                myAmh = GameObject.Find("Panel_GameAMH(Clone)").GetComponent <MyDZPKScript>();
            }
            if (myAmh != null)
            {
                int index = int.Parse(indexStr) - 1;
                //
                //SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myAmh.playerItems[0].showBiaoQing(myAmh.getBqScript().getBiaoqing(index));
            }
        }

        hidePanel();
    }
Пример #4
0
    public void clickmfbq(string indexStr)
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        if (ava == null)
        {
            return;
        }
        CustomSocket.getInstance().sendMsg(new MessageBoxRequest(4, indexStr, GlobalDataScript.loginResponseData.account.uuid, ava.account.uuid));
//		if (myMaj == null) {
//			myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent<MyMahjongScript>();
//		}
//		if (myMaj != null) {
//			int myIndex = myMaj.getMyIndexFromList ();
//			int destAvaIndex = myMaj.getIndex (ava.account.uuid);
//			int seatIndex = destAvaIndex - myIndex;
//			if (seatIndex < 0) {
//				seatIndex = 4 + seatIndex;
//			}
//
//			myMaj.playerItems [seatIndex].showMfbq (0, seatIndex, indexStr);
//		}

        if (GlobalDataScript.roomVo.gameType == 0)
        {
            if (myMaj == null)
            {
                myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript> ();
            }
            if (myMaj != null)
            {
                int myIndex      = myMaj.getMyIndexFromList();
                int destAvaIndex = myMaj.getIndex(ava.account.uuid);
                int seatIndex    = destAvaIndex - myIndex;
                if (seatIndex < 0)
                {
                    seatIndex = 4 + seatIndex;
                }

                myMaj.playerItems [seatIndex].showMfbq(0, seatIndex, indexStr);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 1)
        {
            if (myPdk == null)
            {
                myPdk = GameObject.Find("Panel_GamePDK(Clone)").GetComponent <MyPDKScript> ();
            }
            if (myPdk != null)
            {
                int myIndex      = myPdk.getMyIndexFromList();
                int destAvaIndex = myPdk.getIndex(ava.account.uuid);
                int seatIndex    = destAvaIndex - myIndex;
                if (seatIndex < 0)
                {
                    seatIndex = 3 + seatIndex;
                }

                myPdk.playerItems [seatIndex].showMfbq(0, seatIndex, indexStr);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 3)
        {
            if (myDN == null)
            {
                myDN = GameObject.Find("Panel_GameDN(Clone)").GetComponent <MyDNScript> ();
            }
            if (myDN != null)
            {
                int myIndex      = myDN.getMyIndexFromList();
                int destAvaIndex = myDN.getIndex(ava.account.uuid);
                int seatIndex    = destAvaIndex - myIndex;
                if (seatIndex < 0)
                {
                    seatIndex = 5 + seatIndex;
                }

                myDN.playerItems [seatIndex].showMfbq(0, seatIndex, indexStr);
            }
        }


        closeUserInfoPanel();
    }