示例#1
0
    // Use this for initialization
    void Awake()
    {
        dirIconArr = new List <GameObject>();
        //dirIconPostionArr = new List<Vector3>();
        battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        gameMgrProxy    = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
        playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy;
        Time_m          = transform.Find("Time_m").GetComponent <Image>();
        Time_s          = transform.Find("Time_s").GetComponent <Image>();
        //  masterIcon = transform.Find("MasterIcon").GetComponent<Image>();
        var eastIcon  = transform.Find("bg/EastIcon").gameObject;
        var southIcon = transform.Find("bg/SouthIcon").gameObject;
        var westIcon  = transform.Find("bg/WestIcon").gameObject;
        var northIcon = transform.Find("bg/NorthIcon").gameObject;

        dirIconArr.Add(eastIcon);
        dirIconArr.Add(southIcon);
        dirIconArr.Add(westIcon);
        dirIconArr.Add(northIcon);
        //dirIconPostionArr.Add(eastIcon.transform.localPosition);
        //dirIconPostionArr.Add(southIcon.transform.localPosition);
        //dirIconPostionArr.Add(westIcon.transform.localPosition);
        //dirIconPostionArr.Add(northIcon.transform.localPosition);
        //arrowIcon = transform.Find("ArrowIcon").GetComponent<Image>();
        //arrowEffect = transform.Find("ArrowIcon/ArrowEffect").gameObject;
    }
示例#2
0
    public override void OnRegister()
    {
        base.OnRegister();
        battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        gameMgrProxy    = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
        playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy;
        //View.readyBtn.onClick.AddListener(onReadyClick);
        //View.BackBtn.onClick.AddListener(OnDissloutionClick);
        //View.dissolutionBtn.onClick.AddListener(OnDissloutionClick);
        View.chatBtn.onClick.AddListener(OnChatClick);
        View.settingBtn.onClick.AddListener(OnSettingClick);
        View.inviteBtn.onClick.AddListener(OnInviteClick);
        View.ruleInfoBtn.onClick.AddListener(OnRuleInfoClick);

        View.ExitRoomBtn.onClick.AddListener(OnDissloutionClick);
        View.LeftRoomBtn.onClick.AddListener(OnLeftRoomBtnClick);

        var voideTrigger = View.voiceBtn.GetComponent <EventTrigger>();

        voideTrigger.triggers = new List <EventTrigger.Entry>();
        EventTrigger.Entry onUp = new EventTrigger.Entry();
        onUp.eventID = EventTriggerType.PointerUp;
        onUp.callback.AddListener(OnVoiceUp);
        EventTrigger.Entry onDown = new EventTrigger.Entry();
        onDown.eventID = EventTriggerType.PointerDown;
        onDown.callback.AddListener(OnVoiceDown);
        voideTrigger.triggers.Add(onDown);
        voideTrigger.triggers.Add(onUp);

        View.TouHeBtn.onClick.AddListener(OnClickTouHeBtn);
        View.PassBtn.onClick.AddListener(OnClickPassBtn);
        //View.BaoTingBtn.onClick.AddListener(OnClickBaoTing);
        Timer.Instance.AddTimer(0, 1, 0, InitView);
    }
示例#3
0
 /// <summary>
 /// 发送聊天内容
 /// </summary>
 private void SendMsg()
 {
     if (View.sendInput.text.Length == 0)
     {
         PopMsg.Instance.ShowMsg("请输入聊天内容");
     }
     else
     {
         GameMgrProxy gameMgrProxy =
             ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
         BattleProxy battleProxy =
             ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
         if (gameMgrProxy.systemTime - battleProxy.perSendChatTime < GlobalData.SendChatInvoke)
         {
             PopMsg.Instance.ShowMsg("请不要频繁发送");
             return;
         }
         SendChatC2S sendChatC2S = new SendChatC2S();
         sendChatC2S.content = View.sendInput.text;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_TEXT_CHAT.GetHashCode(), 0, sendChatC2S);
         View.sendInput.text         = "";
         battleProxy.perSendChatTime = gameMgrProxy.systemTime;
         UIManager.Instance.HideUI(UIViewID.CHAT_VIEW);
     }
 }
 public override void OnRegister()
 {
     base.OnRegister();
     battleProxy  = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
     gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
     View.closeBtn.onClick.AddListener(CloseHandler);
     UpdateStatisticsInfo();
 }
示例#5
0
        public override void OnRegister()
        {
            base.OnRegister();
            battleProxy  = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
            gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
            View.closeBtn.onClick.AddListener(OnCloseClick);
            View.shareBtn.onClick.AddListener(OnShaderClick);

            InitUI();
        }
示例#6
0
        void Awake()
        {
            //InitSimulationCard();

            instance        = this;
            battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
            gameMgrProxy    = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
            playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy;
            Application.logMessageReceived += HandleLog;
        }
示例#7
0
    void Awake()
    {
        gameMgrProxy    = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
        battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy;

        for (int i = 0; i < 10; i++)
        {
            ssSprite.Add(Resources.Load <Sprite>("Textures/saizi/" + i));
        }
    }
示例#8
0
    public override void OnRegister()
    {
        base.OnRegister();
        battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        gameMgrProxy    = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
        playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy;

        View.recorder.OnReComplete  = SendAudioToServer;
        View.recorder.OnGetComplete = PlayAudio;
        AudioSystem.Instance.PlayBgm(Resources.Load <AudioClip>("Voices/Bgm/BattleBgm"));

        InitView();
    }
示例#9
0
    public override void OnInit()
    {
        battleProxy  = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;

        ViewRoot = LaunchUIView("Prefab/UI/Battle/DisloveApplyView");

        cancelBtn  = ViewRoot.transform.Find("FlaseButton").GetComponent <Button>();
        confirmBtn = ViewRoot.transform.Find("tureButton").GetComponent <Button>();
        closeBtn   = ViewRoot.transform.Find("CloseBtn").GetComponent <Button>();

        confirmBtn.onClick.AddListener(ConfirmDisloveHandler);
        cancelBtn.onClick.AddListener(CancelDisloveHandler);
        closeBtn.onClick.AddListener(CancelDisloveHandler);
    }
示例#10
0
    void Awake()
    {
        reportSpeedBtn = transform.Find("ReportSpeedBtn").GetComponent <Button>();
        pauseBtn       = transform.Find("PauseBtn").GetComponent <Button>();
        playBtn        = transform.Find("PlayBtn").GetComponent <Button>();
        returnBtn      = transform.Find("ReturnBtn").GetComponent <Button>();

        curSpeed     = speeds[0];
        battleProxy  = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
        reportSpeedBtn.onClick.AddListener(SpeedHandler);
        pauseBtn.onClick.AddListener(PauseHandler);
        playBtn.onClick.AddListener(PlayHandler);
        returnBtn.onClick.AddListener(ReturnHandler);
        playBtn.gameObject.SetActive(false);
    }
示例#11
0
 public override void OnRegister()
 {
     base.OnRegister();
     hallProxy                = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
     gameMgrProxy             = Facade.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
     View.ruleValueTxt.text   = hallProxy.HallInfo.ruleDesc;
     View.rewardValueTxt.text = hallProxy.HallInfo.rewardDesc;
     View.closeBtn.onClick.AddListener(() =>
     {
         UIManager.Instance.HideUI(UIViewID.ARENA_VIEW);
     });
     View.applyBtn.onClick.AddListener(ApplyHandler);
     View.battleBtn.onClick.AddListener(BattleHandler);
     View.rankBtn.onClick.AddListener(RankHandler);
     updateTimeId = Timer.Instance.AddTimer(1, 0, 0, UpdateBtns);
 }
示例#12
0
 void Awake()
 {
     instance        = this;
     battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
     gameMgrProxy    = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
     playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy;
     Application.logMessageReceived += HandleLog;
     for (int i = 0; i < GlobalData.CardWare.Length; i++)
     {
         GlobalData.Test127Queue.Enqueue(GlobalData.CardWare[i]);
     }
     for (int i = 0; i < defaultCardIndex.Length; i++)
     {
         defaultCardIndex[i] = GlobalData.Test127Queue.Dequeue();
     }
 }
示例#13
0
    public override void OnInit()
    {
        battleProxy  = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;

        viewRoot      = LaunchUIView("Prefab/UI/Battle/DisloveApplyView");
        cancelBtn     = viewRoot.transform.Find("CancelBtn").GetComponent <Button>();
        confirmBtn    = viewRoot.transform.Find("ConfirmBtn").GetComponent <Button>();
        remainTimeTxt = viewRoot.transform.Find("ConfirmBtn/RemainTimeTxt").GetComponent <Text>();
        contentTxt    = viewRoot.transform.Find("ContentTxt").GetComponent <Text>();

        confirmBtn.onClick.AddListener(ConfirmDisloveHandler);
        cancelBtn.onClick.AddListener(CancelDisloveHandler);

        contentTxt.text = string.Format("你的牌友{0}正在", battleProxy.playerIdInfoDic[battleProxy.disloveApplyUserId].name);
        timeId          = Timer.Instance.AddTimer(1, 0, 1, UpdateRemainTime);
        UpdateRemainTime();
    }
示例#14
0
        /// <summary>
        /// 发送表情
        /// </summary>
        /// <param name="index"></param>
        private void SendFace(int index)
        {
            GameMgrProxy gameMgrProxy =
                ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
            BattleProxy battleProxy =
                ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;

            if (gameMgrProxy.systemTime - battleProxy.perSendChatTime < GlobalData.SendChatInvoke)
            {
                PopMsg.Instance.ShowMsg("请不要频繁发送");
                return;
            }
            SendChatC2S sendChatC2S = new SendChatC2S();

            sendChatC2S.content = GlobalData.FACE_PREFIX + index;
            NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_TEXT_CHAT.GetHashCode(), 0, sendChatC2S);
            battleProxy.perSendChatTime = gameMgrProxy.systemTime;
            UIManager.Instance.HideUI(UIViewID.CHAT_VIEW);
        }
示例#15
0
 // Use this for initialization
 void Awake()
 {
     dirIconArr        = new List <GameObject>();
     dirIconPostionArr = new List <Vector3>();
     battleProxy       = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
     gameMgrProxy      = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
     playerInfoProxy   = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy;
     remainTimeTxt     = transform.Find("RemainTimeTxt").GetComponent <TextMesh>();
     masterIcon        = transform.Find("MasterIcon").GetComponent <SpriteRenderer>();
     eastIcon          = transform.Find("EastIcon").gameObject;
     southIcon         = transform.Find("SouthIcon").gameObject;
     westIcon          = transform.Find("WestIcon").gameObject;
     northIcon         = transform.Find("NorthIcon").gameObject;
     dirIconArr.Add(eastIcon);
     dirIconArr.Add(southIcon);
     dirIconArr.Add(westIcon);
     dirIconArr.Add(northIcon);
     dirIconPostionArr.Add(eastIcon.transform.localPosition);
     dirIconPostionArr.Add(southIcon.transform.localPosition);
     dirIconPostionArr.Add(westIcon.transform.localPosition);
     dirIconPostionArr.Add(northIcon.transform.localPosition);
     arrowContainer = transform.Find("ArrowContainer");
     arrowIcon      = transform.Find("ArrowContainer/ArrowIcon").GetComponent <SpriteRenderer>();
 }
示例#16
0
 /// <summary>
 /// 启动模块初始化
 /// </summary>
 public override void OnRegister()
 {
     base.OnRegister();
     this.gameManagerProxy = Facade.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
 }