Exemplo n.º 1
0
    public void OpenForm()
    {
        this.chat_cd_timer = Singleton <CTimerManager> .instance.AddTimer(0xbb8, -1, new CTimer.OnTimeUpHandler(this.On_Input_Timer_End));

        Singleton <CTimerManager> .instance.PauseTimer(this.chat_cd_timer);

        this.formScript = Singleton <CUIManager> .GetInstance().OpenForm(CChatController.ChatSelectHeroPath, false, true);

        this.backgroundObject = this.formScript.transform.Find("Background").gameObject;
        this.show_listScript  = this.formScript.transform.Find("chatTools/node/ListView/chatList").gameObject.GetComponent <CUIListScript>();
        this.tablistScript    = this.formScript.transform.Find("chatTools/node/Tab/List").gameObject.GetComponent <CUIListScript>();
        this.tablistScript.SetElementAmount(2);
        CUIListElementScript elemenet = null;

        elemenet = this.tablistScript.GetElemenet(0);
        this.ShowTemplate(elemenet, true);
        elemenet = this.tablistScript.GetElemenet(1);
        this.ShowTemplate(elemenet, false);
        this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true;
        this.tablistScript.SelectElement(0, true);
        this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false;
        this.formScript.transform.Find("bubble_node").gameObject.CustomSetActive(true);
        this.bubbleObj0  = this.formScript.transform.Find("bubble_node/bubble0").gameObject;
        this.bubbleText0 = this.bubbleObj0.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj1  = this.formScript.transform.Find("bubble_node/bubble1").gameObject;
        this.bubbleText1 = this.bubbleObj1.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj2  = this.formScript.transform.Find("bubble_node/bubble2").gameObject;
        this.bubbleText2 = this.bubbleObj2.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj3  = this.formScript.transform.Find("bubble_node/bubble3").gameObject;
        this.bubbleText3 = this.bubbleObj3.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj4  = this.formScript.transform.Find("bubble_node/bubble4").gameObject;
        this.bubbleText4 = this.bubbleObj4.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj0.CustomSetActive(false);
        this.bubbleObj1.CustomSetActive(false);
        this.bubbleObj2.CustomSetActive(false);
        this.bubbleObj3.CustomSetActive(false);
        this.bubbleObj4.CustomSetActive(false);
        this.bottomTextBtn      = this.formScript.transform.Find("chatTools/ChatTextBtn").gameObject;
        this.bottomVoiceBtn     = this.formScript.transform.Find("chatTools/ChatVoiceBtn").gameObject;
        this.inputField         = this.formScript.transform.Find("chatTools/InputField").GetComponent <InputField>();
        this.bottomSendVoiceBtn = this.formScript.transform.Find("chatTools/voice_Btn").gameObject;
        this.textSendBtn        = this.formScript.transform.Find("chatTools/TextSendBtn").gameObject;
        this.chatEntryNode      = this.formScript.transform.Find("entry_node").gameObject;
        this.chatDetailNode     = this.formScript.transform.Find("chatTools").gameObject;
        this.Show_SelectChat_MidNode(false);
        this._tab        = Tab.None;
        this.CurTab      = Tab.Template;
        this.curChatType = enChatType.Text;
        this.OnUpdateBottomButtons();
        this.Refresh_BottomChat();
        MonoSingleton <VoiceSys> .GetInstance().ShowVoiceBtn_HeroSelect(this.formScript);
    }
Exemplo n.º 2
0
    public void OpenForm()
    {
        this.chat_cd_timer = Singleton <CTimerManager> .instance.AddTimer(0xbb8, -1, new CTimer.OnTimeUpHandler(this.On_Input_Timer_End));

        Singleton <CTimerManager> .instance.PauseTimer(this.chat_cd_timer);

        string str = string.Empty;

        if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enNormal)
        {
            str = CChatController.ChatSelectHeroPath_Normal;
        }
        else if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enBanPick)
        {
            str = CChatController.ChatSelectHeroPath_BanPick;
        }
        if (!string.IsNullOrEmpty(str))
        {
            this.formScript = Singleton <CUIManager> .GetInstance().OpenForm(str, false, true);

            this.backgroundObject = this.formScript.transform.Find("Background").gameObject;
            this.show_listScript  = this.formScript.transform.Find("chatTools/node/ListView/chatList").gameObject.GetComponent <CUIListScript>();
            this.tablistScript    = this.formScript.transform.Find("chatTools/node/Tab/List").gameObject.GetComponent <CUIListScript>();
            this.tablistScript.SetElementAmount(2);
            CUIListElementScript elemenet = null;
            elemenet = this.tablistScript.GetElemenet(0);
            this.ShowTemplate(elemenet, true);
            elemenet = this.tablistScript.GetElemenet(1);
            this.ShowTemplate(elemenet, false);
            this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true;
            this.tablistScript.SelectElement(0, true);
            this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false;
            this.formScript.transform.Find("bubble_node").gameObject.CustomSetActive(true);
            this.bubbleObj0  = this.formScript.transform.Find("bubble_node/bubble0").gameObject;
            this.bubbleText0 = this.bubbleObj0.transform.Find("text_bubble0").GetComponent <Text>();
            this.bubbleObj1  = this.formScript.transform.Find("bubble_node/bubble1").gameObject;
            this.bubbleText1 = this.bubbleObj1.transform.Find("text_bubble0").GetComponent <Text>();
            this.bubbleObj2  = this.formScript.transform.Find("bubble_node/bubble2").gameObject;
            this.bubbleText2 = this.bubbleObj2.transform.Find("text_bubble0").GetComponent <Text>();
            this.bubbleObj3  = this.formScript.transform.Find("bubble_node/bubble3").gameObject;
            this.bubbleText3 = this.bubbleObj3.transform.Find("text_bubble0").GetComponent <Text>();
            this.bubbleObj4  = this.formScript.transform.Find("bubble_node/bubble4").gameObject;
            this.bubbleText4 = this.bubbleObj4.transform.Find("text_bubble0").GetComponent <Text>();
            this.bubbleObj0.CustomSetActive(false);
            this.bubbleObj1.CustomSetActive(false);
            this.bubbleObj2.CustomSetActive(false);
            this.bubbleObj3.CustomSetActive(false);
            this.bubbleObj4.CustomSetActive(false);
            this.bottomVoiceBtn      = this.formScript.transform.Find("chatTools/ChatVoiceBtn").gameObject;
            this.inputField          = this.formScript.transform.Find("chatTools/InputField").GetComponent <InputField>();
            this.bottomSendVoiceBtn  = this.formScript.transform.Find("chatTools/voice_Btn").gameObject;
            this.textSendBtn         = this.formScript.transform.Find("chatTools/TextSendBtn").gameObject;
            this.voiceBtnNode        = this.formScript.transform.Find("VoiceBtn").gameObject;
            this.chatEntryNode       = this.formScript.transform.Find("entry_node").gameObject;
            this.chatDetailNode      = this.formScript.transform.Find("chatTools").gameObject;
            this.m_OpenSpeakeObj     = this.formScript.transform.Find("VoiceBtn/Voice_OpenSpeaker");
            this.m_OpenMicObj        = this.formScript.transform.Find("VoiceBtn/Voice_OpenMic");
            this.m_OpenSpeakerTipObj = this.formScript.transform.Find("VoiceBtn/Voice_OpenSpeaker/info");
            if ((this.m_OpenSpeakerTipObj != null) && (this.m_OpenSpeakerTipObj.transform.Find("Text") != null))
            {
                this.m_OpenSpeakerTipText = this.m_OpenSpeakerTipObj.transform.Find("Text").GetComponent <Text>();
            }
            this.m_OpenMicTipObj = this.formScript.transform.Find("VoiceBtn/Voice_OpenMic/info");
            if ((this.m_OpenMicTipObj != null) && (this.m_OpenMicTipObj.transform.Find("Text") != null))
            {
                this.m_OpenMicTipText = this.m_OpenMicTipObj.transform.Find("Text").GetComponent <Text>();
            }
            this.m_Vocetimer = Singleton <CTimerManager> .instance.AddTimer(0x7d0, -1, new CTimer.OnTimeUpHandler(this.OnVoiceTimeEnd));

            Singleton <CTimerManager> .instance.PauseTimer(this.m_Vocetimer);

            Singleton <CTimerManager> .instance.ResetTimer(this.m_Vocetimer);

            this.m_VoiceMictime = Singleton <CTimerManager> .instance.AddTimer(0x7d0, -1, new CTimer.OnTimeUpHandler(this.OnVoiceMicTimeEnd));

            Singleton <CTimerManager> .instance.PauseTimer(this.m_VoiceMictime);

            Singleton <CTimerManager> .instance.ResetTimer(this.m_VoiceMictime);

            MonoSingleton <VoiceSys> .GetInstance().UseMicOnUser = false;

            if (MonoSingleton <VoiceSys> .GetInstance().IsUseVoiceSysSetting)
            {
                this.OnChatHeroSelectOpenSpeaker(true);
            }
            this.Show_SelectChat_MidNode(false);
            this._tab        = Tab.None;
            this.CurTab      = Tab.Template;
            this.curChatType = enChatType.Text;
            this.OnUpdateBottomButtons();
            this.Refresh_BottomChat();
            MonoSingleton <VoiceSys> .GetInstance().ShowVoiceBtn_HeroSelect(this.formScript);
        }
    }