예제 #1
0
    public void showUserInfoPanel()
    {
        SoundCtrl.getInstance().playSoundUI(true);
        //userInfoPanel.SetActive (true);
        GameObject obj = PrefabManage.loadPerfab("Prefab/userInfo");

        obj.GetComponent <ShowUserInfoScript>().setUIData(GlobalDataScript.loginResponseData);
    }
예제 #2
0
 public void clickCancle()
 {
     SoundCtrl.getInstance().playSoundUI();
     dissolveType = "2";
     doDissoliveRoomRequest();
     okButton.transform.gameObject.SetActive(false);
     cancleButton.transform.gameObject.SetActive(false);
 }
예제 #3
0
        public void  openGamePlay()
        {
            SoundCtrl.getInstance().playSoundUI();
            string id = mZhanjiDataItemVo.id + "";

            CustomSocket.getInstance().sendMsg(new GameBackPlayRequest(id));
            PrefabManage.loadPerfab("Prefab/Panel_GamePlayBack");
        }
예제 #4
0
    public void exit()
    {
        SoundCtrl.getInstance().playSoundUI();
        CustomSocket.getInstance().sendMsg(new LoginRequest());

        Application.Quit();
        //多态  调用退出登录接口
    }
예제 #5
0
 public void closeDialog()
 {
     SoundCtrl.getInstance().playSoundByActionButton(1);
     MyDebug.Log("closeDialog");
     SocketEventHandle.getInstance().CreateRoomCallBack -= onCreateRoomCallback;
     Destroy(this);
     Destroy(gameObject);
 }
예제 #6
0
    /**
     *  public void closeUserInfoPanel (){
     *          userInfoPanel.SetActive (false);
     *  }
     */
    public void showRoomCardPanel()
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);



        CustomSocket.getInstance().sendMsg(new GetContactInfoRequest());
    }
예제 #7
0
 public void closexieyi()
 {
     SoundCtrl.getInstance().playSoundByActionButton(1);
     if (Panel_xieyi != null)
     {
         Panel_xieyi.SetActive(false);
     }
 }
예제 #8
0
 public void hidePanel()
 {
     showFrameMask.SetActive(false);
     gameObject.transform.DOLocalMove(new Vector3(667, 0), 0.4f);
     isShowFrame = false;
     showFramebtn.SetActive(true);
     SoundCtrl.getInstance().playSoundUI();
 }
예제 #9
0
 public void showDZPKQiPai()
 {
     //avaZhu_dzpk.gameObject.SetActive (false);
     cleanDZPKtext();
     qipaiImg_dzpk.SetActive(true);
     text_dzpk.text = "弃牌";
     SoundCtrl.getInstance().playSoundByDZPK("qipai", avatarvo.account.sex);
 }
예제 #10
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();
 }
예제 #11
0
 public void clear()
 {
     SoundCtrl.getInstance().playSoundByActionButton(1);
     inputChars.Clear();
     for (int i = 0; i < 6; i++)
     {
         inputTexts[i].text = "";
     }
 }
예제 #12
0
 public void closeDialog()
 {
     SoundCtrl.getInstance().playSoundByActionButton(1);
     MyDebug.Log("closeDialog");
     //GlobalDataScript.homePanel.SetActive (false);
     removeListener();
     Destroy(this);
     Destroy(gameObject);
 }
예제 #13
0
 public void openDevloping()
 {
     SoundCtrl.getInstance().playSoundByActionButton(1);
     panelZhuanzhuanSetting.SetActive(false);
     panelChangshaSetting.SetActive(false);
     panelHuashuiSetting.SetActive(false);
     panelGuangDongSetting.SetActive(false);
     panelDevoloping.SetActive(true);
 }
예제 #14
0
 public void sendBiaoqing(string code)
 {
     SoundCtrl.getInstance().playSoundUI();
     if (myMaj != null)
     {
         CustomSocket.getInstance().sendMsg(new MessageBoxRequest(2, GlobalDataScript.loginResponseData.account.uuid, code));
         hidePanel();
     }
 }
예제 #15
0
 private void buhuaEffect(int cardPoint, int curAvatarIndex)
 {
     if (buhuaTime > 0)
     {
         return;
     }
     SoundCtrl.getInstance().playSoundByAction("buhua", playerItems [curAvatarIndex].getSex(), pathDirString [curAvatarIndex]);
     buhuaTime = 0;
 }
예제 #16
0
    public void closeDialog()
    {
        SoundCtrl.getInstance().playSoundUI();
        RulePanelScript self = GetComponent <RulePanelScript> ();

        self = null;
        Destroy(this);
        Destroy(gameObject);
    }
예제 #17
0
 public void PlayClipDataBy()//(AudioCallBack callback)
 {
     SoundCtrl.getInstance().playBGM(0);
     playAudio.volume = GlobalDataScript.yinxiaoVolume;
     playAudio.Play();
     Debug.Log("***************------播放录音-----ime =");
     Debug.Log("***************------playAudio.clip.length=" + playAudio.clip.length);
     StartCoroutine(DelayedCallback(playAudio.clip.length));//(playAudio.clip.length, callback));
 }
예제 #18
0
 public void settingClick()
 {
     SoundCtrl.getInstance().playSoundUI();
     if (isShowFrame)
     {
         hideSettingFrame();
     }
     soundSetting.SetActive(true);
 }
예제 #19
0
    public void messageBoxNotice(ClientResponse response)
    {
        string[] arr = response.message.Split(new char[1] {
            '|'
        });
        int code = int.Parse(arr[0]);

        SoundCtrl.getInstance().playMessageBoxSound(code);
    }
예제 #20
0
    private IEnumerator DelayedCallback(float time)
    {
        Debug.Log("***************-----------***********---------+time =" + time);
        time = 5;        //这里获取不了声音的时间
        yield return(new WaitForSeconds(time));

        // callback();
        SoundCtrl.getInstance().playBGM(2);
    }
예제 #21
0
 public void deleteNumber()
 {
     SoundCtrl.getInstance().playSoundByActionButton(1);
     if (inputChars != null && inputChars.Count > 0)
     {
         inputChars.RemoveAt(inputChars.Count - 1);
         inputTexts[inputChars.Count].text = "";
     }
 }
예제 #22
0
    public void cancle()
    {
        SoundCtrl.getInstance().playSoundUI();
        ExitAppScript self = GetComponent <ExitAppScript> ();

        self = null;
        Destroy(self);
        Destroy(gameObject);
    }
예제 #23
0
    public static SoundCtrl getInstance()
    {
        if (_instance == null)
        {
            _instance = new SoundCtrl();
            audioS    = GameObject.Find("MyAudio").GetComponent <AudioSource> ();
        }

        return(_instance);
    }
예제 #24
0
 public void displayAvatorIp()
 {
     //userInfoPanel.SetActive (true);
     if (avatarvo != null)
     {
         GameObject obj = PrefabManage.loadPerfab("Prefab/userInfo");
         obj.GetComponent <ShowUserInfoScript>().setUIData(avatarvo);
         SoundCtrl.getInstance().playSoundByActionButton(1);
     }
 }
 public static SoundCtrl getInstance()
 {
     if (_instant == null)
     {
         _instant   = new SoundCtrl();
         audioSouce = GameObject.FindWithTag("SoundManager").GetComponent <AudioSource>();
         audioBGM   = GameObject.FindWithTag("BGMaudioManage").GetComponent <AudioSource>();
     }
     return(_instant);
 }
예제 #26
0
    /**
     * 打开设置对话框
     */
    public void openGameSettingDialog()
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        loadPerfab("Prefab/Panel_Setting");

        SettingScript ss = panelCreateDialog.GetComponent <SettingScript>();

        ss.jiesanBtn.GetComponentInChildren <Text>().text = "退出游戏";
        ss.type = 1;
    }
예제 #27
0
 public void closeDialog()
 {
     SoundCtrl.getInstance().playSoundByActionButton(1);
     MyDebug.Log("closeDialog");
     SocketEventHandle.getInstance().CreateRoomCallBack -= onCreateRoomCallback;
     SocketEventHandle.getInstance().JoinRoomCallBack   -= onJoinRoomCallBack;
     SocketEventHandle.getInstance().serviceErrorNotice -= serviceResponse;
     Destroy(this);
     Destroy(gameObject);
 }
예제 #28
0
    /**
     * 创建划水麻将房间
     */
    public void createHuashuiRoom()
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        int  roundNumber = 4;     //房卡数量
        bool isZimo      = false; //自摸
        bool isFengpai   = false; //七小对
        int  maCount     = 0;

        for (int i = 0; i < huashuiRoomCards.Count; i++)
        {
            Toggle item = huashuiRoomCards [i];
            if (item.isOn)
            {
                if (i == 0)
                {
                    roundNumber = 8;
                }
                else if (i == 1)
                {
                    roundNumber = 16;
                }
                break;
            }
        }
        if (huashuiGameRule [0].isOn)
        {
            isFengpai = true;
        }
        if (huashuiGameRule [1].isOn)
        {
            isZimo = true;
        }


        for (int i = 0; i < huashuixiayu.Count; i++)
        {
            if (huashuixiayu [i].isOn)
            {
                maCount = 2 * (i + 1) + i;
                break;
            }
        }

        sendVo             = new RoomCreateVo();
        sendVo.xiaYu       = maCount;
        sendVo.roundNumber = roundNumber;
        sendVo.ziMo        = isZimo?1:0;
        sendVo.roomType    = (int)GameType.GameType_MJ_HuaShui;
        sendVo.addWordCard = isFengpai;
        sendVo.sevenDouble = true;
        sendVo.goldType    = GlobalDataScript.goldType;
        string sendmsgstr = JsonMapper.ToJson(sendVo);

        ReqForCreateRoom(sendmsgstr);
    }
예제 #29
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();
    }
예제 #30
0
    /**
     * 创建长沙麻将房间
     */
    public void createChangshaRoom()
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        int  roundNumber = 4;     //房卡数量
        bool isZimo      = false; //自摸
        int  maCount     = 0;

        for (int i = 0; i < changshaRoomCards.Count; i++)
        {
            Toggle item = changshaRoomCards [i];
            if (item.isOn)
            {
                if (i == 0)
                {
                    roundNumber = 8;
                }
                else if (i == 1)
                {
                    roundNumber = 16;
                }
                break;
            }
        }
        if (changshaGameRule [0].isOn)
        {
            isZimo = true;
        }

        for (int i = 0; i < changshaZhuama.Count; i++)
        {
            if (changshaZhuama [i].isOn)
            {
                maCount = 2 * (i + 1);
                break;
            }
        }

        sendVo             = new RoomCreateVo();
        sendVo.ma          = maCount;
        sendVo.roundNumber = roundNumber;
        sendVo.ziMo        = isZimo?1:0;
        sendVo.roomType    = GameConfig.GAME_TYPE_CHANGSHA;
        string sendmsgstr = JsonMapper.ToJson(sendVo);

        if (GlobalDataScript.loginResponseData.account.roomcard > 0)
        {
            watingPanel.gameObject.SetActive(true);
            CustomSocket.getInstance().sendMsg(new CreateRoomRequest(sendmsgstr));
        }
        else
        {
            TipsManagerScript.getInstance().setTips("你的房卡数量不足,不能创建房间");
        }
    }