Exemplo n.º 1
0
 /// <summary>
 /// 点击关闭协议界面按钮
 /// </summary>
 /// <param name="eventtype"></param>
 /// <param name="button"></param>
 /// <param name="eventData"></param>
 private void OnClickCloseAgreement(EventTriggerType eventtype, object button, PointerEventData eventData)
 {
     if (eventtype == EventTriggerType.PointerClick)
     {
         CustomAudio.GetInstance().PlayCustomAudio(1002);
         GameObject protocolObj = CanvasObj.transform.Find("Login").Find("Image_protocol").gameObject;
         protocolObj.SetActive(false);
     }
 }
Exemplo n.º 2
0
    private void OnOpenCreatePanel(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            LoadCreatePanel();
        }
    }
Exemplo n.º 3
0
    private void OnCloseCreatePanel(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            createPanel_.SetActive(false);
        }
    }
Exemplo n.º 4
0
    private void OnJoin(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            NumberPanel.GetInstance().SetNumberPanelActive(true, SendJoinMsg);
        }
    }
Exemplo n.º 5
0
 /// <summary>
 /// 关闭兑换界面按钮事件
 /// </summary>
 void OnClickCloseExchangeEvent(EventTriggerType eventtype, object button, PointerEventData eventData)
 {
     if (eventtype != EventTriggerType.PointerClick)
     {
         return;
     }
     CustomAudio.GetInstance().PlayCustomAudio(1002);
     CloseExchangeEvent();
 }
Exemplo n.º 6
0
    void InitRulePanel(ESlefContestType createtype)
    {
        switch (createtype)
        {
        case ESlefContestType.PlayerNumberContest:
        {
            GameObject returnBtn1 = rulepanel1_.transform.Find("Top/ButtonReturn").gameObject;
            XPointEvent.AutoAddListener(returnBtn1, OnBack2SelfContest, null);

            Text diamond1 = rulepanel1_.transform.Find("Top/Image_DiamondFrame/Text_Diamond").gameObject.GetComponent <Text>();
            diamond1.text = (GameMain.hall_.GetPlayerData().GetDiamond() + GameMain.hall_.GetPlayerData().GetCoin()).ToString();

            GameObject togglebg1 = rulepanel1_.transform.Find("Left").gameObject;
            for (int index = 0; index < togglebg1.transform.childCount; index++)
            {
                Toggle toggle = togglebg1.transform.GetChild(index).gameObject.GetComponent <Toggle>();
                int    temp   = index;
                toggle.onValueChanged.AddListener(delegate(bool value) {
                        CustomAudio.GetInstance().PlayCustomAudio(1003);
                        ChangeRuleInfo(temp, value, createtype);
                    });
            }
            InitRightRuleEvents(rulepanel1_, createtype);
        }
        break;

        case ESlefContestType.TimeContest:
        {
            GameObject returnBtn2 = rulepanel2_.transform.Find("Top/ButtonReturn").gameObject;
            XPointEvent.AutoAddListener(returnBtn2, OnBack2SelfContest, null);

            Text diamond2 = rulepanel2_.transform.Find("Top/Image_DiamondFrame/Text_Diamond").gameObject.GetComponent <Text>();
            diamond2.text = (GameMain.hall_.GetPlayerData().GetDiamond() + GameMain.hall_.GetPlayerData().GetCoin()).ToString();

            GameObject togglebg2 = rulepanel2_.transform.Find("Left").gameObject;
            for (int index = 0; index < togglebg2.transform.childCount; index++)
            {
                Toggle toggle = togglebg2.transform.GetChild(index).gameObject.GetComponent <Toggle>();
                int    temp   = index;
                toggle.onValueChanged.AddListener(delegate(bool value) {
                        CustomAudio.GetInstance().PlayCustomAudio(1003);
                        ChangeRuleInfo(temp, value, createtype);
                    });
            }

            InitRightRuleEvents(rulepanel2_, createtype);
        }
        break;
        }
        InitMatchData(createtype);
        SelfContestDataManager.instance().gameid = (byte)GameKind_Enum.GameKind_LandLords;
        RefreshPayInfo(1, createtype);
        RefreshPlayerNumber(SelfContestDataManager.instance().gameid, createtype);
        CurContestGameIndex = 0;
        SelfContestDataManager.instance().SetGameDataID((int)createtype * 3);
    }
Exemplo n.º 7
0
    void OnClickSpeed(float speed, int index)
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);
        m_fSpeed = speed;

        m_SpeedBtns[index - 1].gameObject.SetActive(false);
        int next = index == m_SpeedBtns.Length ? 0 : index;

        m_SpeedBtns[next].gameObject.SetActive(true);
    }
Exemplo n.º 8
0
    //创建比赛
    private void OnCreateContest()
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        if (selfcreateNumber_ >= 10)
        {
            CCustomDialog.OpenCustomConfirmUI(1651);
            return;
        }

        byte gameid = SelfContestDataManager.instance().gameid;
        int  power  = SelfContestDataManager.instance().selfcontestcsvs[gameid].datas[0];
        int  level  = SelfContestDataManager.instance().selfcontestcsvs[gameid].datas[playtimesindex_];

        int pay4appointment = power * level;

        if (GameMain.hall_.GetPlayerData().GetDiamond() + GameMain.hall_.GetPlayerData().GetCoin() < pay4appointment)
        {
            CCustomDialog.OpenCustomConfirmUI(1501);
            return;
        }

        UMessage createContestDataMsg = new UMessage((uint)GameCity.EMSG_ENUM.Contestmsg_PlayerCreateContestRequest);

        createContestDataMsg.Add(GameMain.hall_.GetPlayerId());
        createContestDataMsg.Add(SelfContestDataManager.instance().gamedataid);
        createContestDataMsg.Add(scr_.playernumber);
        createContestDataMsg.Add(scr_.cost);
        createContestDataMsg.Add(scr_.precontest);
        createContestDataMsg.Add(scr_.finalcontest);

        Debug.Log(" 比赛游戏:" + SelfContestDataManager.instance().gamedataid + " 比赛人数:" + scr_.playernumber + " 报名费:" + scr_.cost + "预赛场数:" + scr_.precontest + " 决赛场数" + scr_.finalcontest);

        if (rulepanel2_ == null)
        {
            createContestDataMsg.Add((uint)0);
        }
        else
        {
            if (!rulepanel2_.activeSelf)
            {
                createContestDataMsg.Add((uint)0);
            }
            else
            {
                createContestDataMsg.Add(scr_.timeseconds);
            }
        }

        NetWorkClient.GetInstance().SendMsg(createContestDataMsg);

        UnityEngine.Transform groupTransform = rulepanel1_ ? rulepanel1_.transform : rulepanel2_.transform;
        groupTransform.Find("Right/ImageBG/Button_chuangjian").GetComponent <Button>().interactable   = false;
        groupTransform.Find("Right/ImageBG/Button_chuangjian_0").GetComponent <Button>().interactable = false;
    }
Exemplo n.º 9
0
 public void PlaySound(int audioId)
 {
     if (hall)
     {
         CustomAudio.GetInstance().PlayCustomAudio((uint)audioId);
     }
     else
     {
         CustomAudioDataManager.GetInstance().PlayAudio(audioId);
     }
 }
Exemplo n.º 10
0
    private void OnCloseSign(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            //关闭指引
            GameObject jiaocheng = root_.transform.Find("Pop_up/jiaocheng").gameObject;
            jiaocheng.SetActive(false);
        }
    }
Exemplo n.º 11
0
 //红包兑换钻石事件
 private void OnDiamondSign(EventTriggerType eventtype, object button, PointerEventData eventData)
 {
     if (eventtype == EventTriggerType.PointerClick)
     {
         CustomAudio.GetInstance().PlayCustomAudio(1002);
         if (ExchangePanelTransform)
         {
             ExchangePanelTransform.gameObject.SetActive((bool)button);
         }
     }
 }
Exemplo n.º 12
0
 //最大红包事件
 private void OnMaxDiamondSign(EventTriggerType eventtype, object button, PointerEventData eventData)
 {
     if (eventtype == EventTriggerType.PointerClick)
     {
         CustomAudio.GetInstance().PlayCustomAudio(1002);
         if (ExchangePanelTransform)
         {
             RedBagInputField.text = Mathf.Floor(GameMain.hall_.GetPlayerData().UnreceivedRedBag).ToString();
         }
     }
 }
Exemplo n.º 13
0
    private void OnOpenTimeSet(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);
            Transform rulebg = (Transform)button;

            GameObject timesetpanel = rulebg.parent.parent.Find("Pop-up/shijian_set").gameObject;
            timesetpanel.SetActive(true);
        }
    }
Exemplo n.º 14
0
    /// <summary>
    /// 返回选择登陆方式
    /// </summary>
    void OnBtn_ReturnChooseType(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            InputField CodePanel = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").Find("InputField_Code").gameObject.GetComponent <InputField>();
            CodePanel.text = "";

            LoadChooseLoginType();
        }
    }
Exemplo n.º 15
0
    /// <summary>
    /// 获取验证码
    /// </summary>
    void OnBtn_GetCode(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            if (CanvasObj == null)
            {
                CanvasObj = GameObject.Find("Canvas/Root");
            }

            InputField PhonePanel = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin")
                                    .Find("InputField_PhoneNum").gameObject.GetComponent <InputField>();

            long phonenum = 0;
            if (!long.TryParse(PhonePanel.text, out phonenum))
            {
                CCustomDialog.OpenCustomConfirmUI(1003);
                return;
            }

            if (!GameCommon.CheckPhoneIsAble(PhonePanel.text))
            {
                CCustomDialog.OpenCustomConfirmUI(1003);
                return;
            }

            if (phonenum > 0)
            {
                if (!NetWorkClient.GetInstance().IsSocketConnected)
                {
                    HallMain.ConnectLoginServer();
                }
                SendApplyGetCode(phonenum, 1);

                //if(MobileCodeTimer == null)
                MobileCodeTimer = new CTimerPersecondCall(60f, UpdataGetCodeBtnText);
                xTimeManger.Instance.RegisterTimer(MobileCodeTimer);

                GameObject PhoneLogin = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").gameObject;
                if (null != PhoneLogin)
                {
                    Button btn    = PhoneLogin.transform.Find("Button_GetCode").gameObject.GetComponent <Button>();
                    Image  btnimg = PhoneLogin.transform.Find("Button_GetCode").gameObject.GetComponent <Image>();
                    btn.interactable     = false;
                    btnimg.raycastTarget = false;

                    Text strCode = PhoneLogin.transform.Find("Button_GetCode").Find("Text_GetCode").gameObject.GetComponent <Text>();
                    strCode.text = "60S可重新获取";
                }
            }
        }
    }
Exemplo n.º 16
0
    private void OnGetGoodsFromMail(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick && m_MailinfoTransform != null)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            AssetBundle bundle = AssetBundleManager.GetAssetBundle(GameDefine.HallAssetbundleName);
            if (bundle == null)
            {
                return;
            }

            AssetBundle bagbundle = AssetBundleManager.GetAssetBundle(GameDefine.HallBagIconAssetBundleName);
            if (bagbundle == null)
            {
                return;
            }

            Transform ImageBGTransform = m_MailinfoTransform.Find("ImageBG");

            uint       key    = (uint)button;
            GameObject itembg = ImageBGTransform.Find("Viewport/Content").gameObject;
            GameMain.hall_.ClearChilds(itembg);

            Text infomation = ImageBGTransform.Find("Textinfo").gameObject.GetComponent <Text>();
            infomation.text = EmailDataManager.GetNewsInstance().emilsdata_[key].infomation;

            GameObject confirmbtn = ImageBGTransform.Find("Button_queding").gameObject;
            confirmbtn.SetActive(false);
            GameObject getbtn = ImageBGTransform.Find("Button_lingqu").gameObject;
            getbtn.SetActive(true);
            getbtn.GetComponent <Button>().interactable = true;

            XPointEvent.AutoAddListener(getbtn, OnGetGoods, key);

            for (int index = 0; index < EmailDataManager.GetNewsInstance().emilsdata_[key].emailitems.Count; index++)
            {
                uint itemid = EmailDataManager.GetNewsInstance().emilsdata_[key].emailitems[index].itemid;

                UnityEngine.Object obj0    = (GameObject)bundle.LoadAsset("mail_icon");
                GameObject         itemobj = (GameObject)GameMain.instantiate(obj0);

                itemobj.transform.SetParent(itembg.transform, false);

                Image icon = itemobj.transform.Find("Imageicon").gameObject.GetComponent <Image>();
                icon.sprite = bagbundle.LoadAsset <Sprite>(BagDataManager.GetBagDataInstance().GetItemData(itemid).itemIcon);
                Text number = itemobj.transform.Find("Textnum").gameObject.GetComponent <Text>();
                number.text = EmailDataManager.GetNewsInstance().emilsdata_[key].emailitems[index].itemNumber.ToString();
            }

            m_MailinfoTransform.gameObject.SetActive(true);
        }
    }
Exemplo n.º 17
0
    void OnClickDeskReady()
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        TableTfm.Find("bottom/Button_Ready").GetComponent <Button>().interactable = false;

        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_CM_APPLYREADY);

        msg.Add((byte)GameMain.hall_.GameBaseObj.GetGameType());
        msg.Add(GameMain.hall_.GetPlayerId());
        HallMain.SendMsgToRoomSer(msg);
    }
Exemplo n.º 18
0
    void OnClickSign()
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        m_SignBtn.interactable = false;

        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_GETWEEKOROLDREWORD);

        msg.Add((byte)1);
        msg.Add(GameMain.hall_.GetPlayerId());
        NetWorkClient.GetInstance().SendMsg(msg);
    }
Exemplo n.º 19
0
    void OnClickQuickMatch()
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);
        CCustomDialog.OpenCustomWaitUI("正在进入...");

        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_CM_APPLYQUITSTARTGAME);

        msg.Add((byte)GameMain.hall_.GameBaseObj.GetGameType());
        msg.Add(GameMain.hall_.CurRoomIndex);
        msg.Add(GameMain.hall_.GetPlayerId());
        HallMain.SendMsgToRoomSer(msg);
    }
Exemplo n.º 20
0
    private void OnUseItem(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            ushort itemid = (ushort)button;
            SetItemInfo(itemid);

            SetItemInfoPanelActive(true);
        }
    }
Exemplo n.º 21
0
    public void OnClickWatch(AppointmentRecord record)
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        Init();

        m_CurData = record;

        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CCVideoMsg_ApplyGetRoundScore);

        msg.Add(record.videoes);
        HallMain.videotcpclient.SendMsg(msg);
    }
Exemplo n.º 22
0
    private void OnCloseTimeSet(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            GameObject rulepanel = (GameObject)button;

            GameObject timesetpanel = rulepanel.transform.Find("Pop-up/shijian_set").gameObject;
            timesetpanel.SetActive(false);
            RefreshContestTime(rulepanel.transform, DateControl._hour, DateControl._minute);
        }
    }
Exemplo n.º 23
0
 /// <summary>
 /// 数字密码按钮点击事件
 /// </summary>
 private void OnClickNumberEvent(EventTriggerType eventtype, object button, PointerEventData eventData)
 {
     if (eventtype == EventTriggerType.PointerClick)
     {
         CustomAudio.GetInstance().PlayCustomAudio(1002);
         if (InputNumberText.Length < 5)
         {
             int number = (int)button;
             InputNumberText += number.ToString();
             UpdateInputText();
         }
     }
 }
Exemplo n.º 24
0
    /// <summary>
    /// 删除当前输入事件
    /// </summary>
    private void OnClickBackSpaceEvent(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            if (!string.IsNullOrEmpty(InputNumberText))
            {
                InputNumberText = InputNumberText.Remove(InputNumberText.Length - 1, 1);
            }

            UpdateInputText();
        }
    }
Exemplo n.º 25
0
    private void OnPickContestType(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            ESlefContestType createtype = (ESlefContestType)button;

            LoadRulePanel(createtype);

            if (rulepanel1_ != null)
            {
                rulepanel1_.SetActive(false);
            }
            if (rulepanel2_ != null)
            {
                rulepanel2_.SetActive(false);
            }

            createPanel_.SetActive(false);

            int SelfGameDataIndex = ((int)createtype) * 3 + CurContestGameIndex;
            SelfContestDataManager.instance().SetGameDataID(SelfGameDataIndex);
            switch (createtype)
            {
            case ESlefContestType.TimeContest:
            {
                rulepanel2_.SetActive(true);
                GameObject BG = rulepanel2_.transform.Find("Right").gameObject;
                for (int index = 0; index < 3; index++)
                {
                    Text texttips = BG.transform.GetChild(index).Find("shijian/Text_tips").gameObject.GetComponent <Text>();
                    RefreshContestTimeTipsText(texttips);
                }
            }
            break;

            case ESlefContestType.PlayerNumberContest:
            {
                rulepanel1_.SetActive(true);
            }
            break;
            }

            UnityEngine.Transform groupTransform = rulepanel1_ ? rulepanel1_.transform : rulepanel2_.transform;
            groupTransform.Find("Right/ImageBG/Button_chuangjian").GetComponent <Button>().interactable   = true;
            groupTransform.Find("Right/ImageBG/Button_chuangjian_0").GetComponent <Button>().interactable = true;
            RefreshContestTime(groupTransform);
        }
    }
Exemplo n.º 26
0
 void OnClickReturn(int index)//0:lobby 1:inGame
 {
     CustomAudio.GetInstance().PlayCustomAudio(1002);
     if (index == 0)
     {
         GameOver();
     }
     else
     {
         OnEnd();
         GameMain.hall_.GameBaseObj.OnVideoReplay();
         GameMain.hall_.SwitchToHallScene(true, 5);
     }
 }
Exemplo n.º 27
0
    private static void OnDialogUIBtnClick(EventTriggerType eventtype, object parma, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            DialogFuncCallBack(parma);
            CustomDialogObj.SetActive(false);
            if (DialogTimer != null)
            {
                DialogTimer.SetDeleteFlag(true);
            }
        }
    }
Exemplo n.º 28
0
    private void OnUseTicket(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            GameMain.hall_.Go2ContestHall();
            ushort itemid = (ushort)button;
            BagDataManager.GetBagDataInstance().isUseItem = true;
            BagDataManager.GetBagDataInstance().scriptid  = BagDataManager.GetBagDataInstance().bagitemsdata_[itemid].itemScriptid;

            root_.SetActive(false);
            SetItemInfoPanelActive(false);
        }
    }
Exemplo n.º 29
0
 /// <summary>
 /// �ر�ͨ��ȷ�Ͽ�
 /// </summary>
 /// <param name="eventtype"></param>
 /// <param name="parma"></param>
 /// <param name="eventData"></param>
 private static void CloseCustomConfirmUI(EventTriggerType eventtype, object parma, PointerEventData eventData)
 {
     if (eventtype == EventTriggerType.PointerClick)
     {
         CustomAudio.GetInstance().PlayCustomAudio(1002);
         if (CustomConfirmObj != null)
         {
             CustomConfirmObj.SetActive(false);
             if (ConfirmFuncCallBack != null)
             {
                 ConfirmFuncCallBack(parma);
             }
         }
     }
 }
Exemplo n.º 30
0
    void OnClickSit(ushort desk, sbyte sit)
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        DebugLog.Log("Click desk:" + desk + " sit:" + sit);

        CCustomDialog.OpenCustomWaitUI("正在进入...");

        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_CM_APPLYENTERROOMANDSIT);

        msg.Add((byte)GameMain.hall_.GameBaseObj.GetGameType());
        msg.Add(GameMain.hall_.GetPlayerId());
        msg.Add(desk);
        msg.Add(sit);
        HallMain.SendMsgToRoomSer(msg);
    }