Example #1
0
    void Awake()
    {
        battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy;
        headBtn         = transform.FindChild("Head").GetComponent <Button>();
        nameTxt         = transform.FindChild("NameTxt").GetComponent <Text>();
        coinTxt         = transform.FindChild("CoinTxt").GetComponent <Text>();
        headIcon        = transform.FindChild("Head/HeadIcon").GetComponent <RawImage>();
        readyIcon       = transform.FindChild("ReadyIcon").gameObject;
        bankerIcon      = transform.FindChild("BankerIcon").gameObject;
        voicePlayIcon   = transform.FindChild("VoicePlayIcon").gameObject;
        voiceValueIcon  = transform.FindChild("VoicePlayIcon/VoiceValueIcon").GetComponent <Image>();
        chatView        = transform.FindChild("ChatView").gameObject;
        chatTxt         = transform.FindChild("ChatView/ChatTxt").GetComponent <Text>();
        faceIcon        = transform.FindChild("FaceIcon").GetComponent <Image>();
        //creatorIcon = transform.FindChild("Head/CreatorIcon").gameObject;
        waitingIcon = transform.FindChild("WaitingIcon").gameObject;
        huView      = transform.FindChild("HuView");
        touheObj    = transform.FindChild("touhe").gameObject;
        baoImg      = transform.FindChild("diao").GetComponent <Image>();
        baoEffect   = transform.FindChild("baoEffect");
        //offlineIcon = transform.FindChild("Head/OfflineIcon").gameObject;

        headBtn.onClick.AddListener(OpenPlayerInfo);
    }
Example #2
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;
    }
Example #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);
     }
 }
Example #4
0
    void Update()
    {
        if (m_unListRoleHitted != null)
        {
            print("攻击到的人的个数:" + m_unListRoleHitted.Count);
            PkmodelAdmin.RefreshList(m_unListRoleHitted, HittedisProfession);/*, HittedisProfessionByRedname*/
            if (m_unListRoleHitted != null)
            {
                int lockId = -1;
                if (SelfRole._inst.m_LockRole != null && m_unListRoleHitted.Contains(SelfRole._inst.m_LockRole.m_unIID))
                {
                    lockId = (int)SelfRole._inst.m_LockRole.m_unIID;
                }
                //if(m_unListRoleHitted.Count<=0)
                //{
                //    print("空的");
                //}
                //else
                //{
                //    for (int i = 0; i < m_unListRoleHitted.Count; i++)
                //    {
                //        print("发送的iid是多少:" + m_unListRoleHitted[i]);
                //    }
                //}

                BattleProxy.getInstance().sendcast_target_skill(m_unSkillID, m_unListRoleHitted, m_nLastHit, lockId);
                m_unListRoleHitted = null;
                HittedisProfession = null;
                //HittedisProfessionByRedname = null;
            }
        }
    }
Example #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;
        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);
    }
Example #6
0
    // Use this for initialization
    void Awake()
    {
        battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        battleAreaItems = new List <BattleAreaItem>();
        //saizi1 = transform.FindChild("saizi1").gameObject;
        //saizi2 = transform.FindChild("saizi2").gameObject;
        downArea      = transform.Find("DownArea").gameObject.GetComponent <BattleAreaItem>();
        rightArea     = transform.Find("RightArea").gameObject.GetComponent <BattleAreaItem>();
        upArea        = transform.Find("UpArea").gameObject.GetComponent <BattleAreaItem>();
        leftArea      = transform.Find("LeftArea").gameObject.GetComponent <BattleAreaItem>();
        cardArrowIcon = transform.Find("CardArrowIcon").gameObject;
        masterView    = transform.Find("MasterContainer/MasterView").GetComponent <MasterView>();
        saizi         = transform.Find("saizi").gameObject;
        saizi1        = transform.Find("saizi/saizi1").gameObject;
        saizi2        = transform.Find("saizi/saizi2").gameObject;
        cardArrowIcon.SetActive(false);
        battleAreaItems.Add(downArea);
        battleAreaItems.Add(rightArea);
        battleAreaItems.Add(upArea);
        battleAreaItems.Add(leftArea);
        for (int i = 0; i < battleAreaItems.Count; i++)
        {
            battleAreaItems[i].heapStartIndex = i * GlobalData.CardWare.Length / GlobalData.SIT_NUM;
            battleAreaItems[i].heapEndIndex   = battleAreaItems[i].heapStartIndex + GlobalData.CardWare.Length / GlobalData.SIT_NUM - 1;
        }

        recorder = new RecorderSystem();

        //saizi1Clip = Resources.Load<AnimationClip>("Animation/saizi1");
        //saizi2Clip = Resources.Load<AnimationClip>("Animation/saizi2");

        UIManager.Instance.ShowUI(UIViewID.BATTLE_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();
 }
Example #8
0
 public override void OnRegister()
 {
     base.OnRegister();
     battleProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
     playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy;
     View.startNextBtn.onClick.AddListener(OnStartNextClick);
     //View.shareBtn.onClick.AddListener(OnShaderClick);
     InitUI();
 }
Example #9
0
 public Battle(BattleProxy clientA, BattleProxy clientB, ILog debugLog, OnEndGameDelegate onEndGameDelegate)
 {
     DebugLog       = debugLog;
     ClientA        = clientA;
     ClientB        = clientB;
     GameManager    = new GameManager(this, clientA, clientB, onEndGameDelegate);
     clientA.Battle = this;
     clientB.Battle = this;
 }
Example #10
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;
        }
Example #11
0
    private void Init()
    {
        messages   = new List <Message> ();
        characters = new Dictionary <UInt32, Character> ();

        networkManager = new NetworkManager(this);
        networkManager.Start();

        battleProxy = new BattleProxy(this);
    }
Example #12
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();
        }
Example #13
0
    public override void OnRegister()
    {
        base.OnRegister();
        battleproxy = Facade.RetrieveProxy(BattleProxy.NAME) as BattleProxy;
        if (null == battleproxy)
        {
            throw new Exception("获取" + BattleProxy.NAME + "代理失败");
        }

        //Adds
    }
Example #14
0
        /// <summary>
        /// 冲牌池内获取牌
        /// </summary>
        /// <param name="cardValue"></param>
        /// <returns></returns>
        public GameObject GetFromPool(int cardValue)
        {
            GameObject addCard;

            battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
            if (cardPoolList.Count > 0)
            {
                addCard = cardPoolList [cardPoolList.Count - 1];
                cardPoolList.RemoveAt(cardPoolList.Count - 1);
                addCard.SetActive(true);
            }
            else
            {
                addCard = GameObject.Instantiate(ResourcesMgr.Instance.CardPerfab);
            }
            if (addCard.transform.childCount > 0)
            {
                UnityEngine.Object.Destroy(addCard.transform.GetChild(0).gameObject);
            }
            if (cardValue != 0 && cardValue == battleProxy.treasureCardCode)
            {
                if (addCard.transform.childCount == 0)
                {
                    GameObject go = new GameObject();
                    go.AddComponent <SpriteRenderer>();
                    go.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Textures/UI/treasureCardCode");
                    go.layer = LayerMask.NameToLayer("SelfHandCards");
                    go.transform.SetParent(addCard.transform);
                    go.transform.localPosition = new Vector3(-0.117f, -0.179f, 0.21f);
                    go.transform.localRotation = Quaternion.Euler(new Vector3(-90f, 132f, 47));
                    go.transform.localScale    = new Vector3(.8f, .8f, .8f);
                    //Debug.Log("从getfrompool生成精牌");
                }
            }
            if (cardValue != battleProxy.treasureCardCode)
            {
                if (addCard.transform.childCount > 0)
                {
                    for (int j = 0; j < addCard.transform.childCount; j++)
                    {
                        UnityEngine.GameObject.Destroy(addCard.transform.GetChild(j));
                    }
                }
            }
            var meshFilter = addCard.GetComponent <MeshFilter> ();

            if (cardValue != 0)
            {
                meshFilter.mesh = ResourcesMgr.Instance.GetCardMesh(cardValue);
            }
            meshFilter.mesh.name = meshFilter.mesh.name.Replace(" Instance", "");

            return(addCard);
        }
Example #15
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));
        }
    }
Example #16
0
    // Use this for initialization
    public override void OnInit()
    {
        viewRoot = this.LaunchUIView("Prefab/UI/Battle/BattleView");
        //saizi1 = viewRoot.transform.FindChild("saizi1").gameObject;
        //saizi2 = viewRoot.transform.FindChild("saizi2").gameObject;
        dateTxt = viewRoot.transform.Find("RoomInfoBg/DateTxt").GetComponent<Text>();
        timeTxt = viewRoot.transform.Find("RoomInfoBg/TimeTxt").GetComponent<Text>();
        roomIdTxt = viewRoot.transform.Find("RoomInfoBg/RoomIdTxt").GetComponent<Text>();
        roundTxt = viewRoot.transform.Find("RoomInfoBg/RoundTxt").GetComponent<Text>();
        leftCardNumTxt = viewRoot.transform.Find("RoomInfoBg/LeftCardNumTxt").GetComponent<Text>();
        netIcon = viewRoot.transform.Find("RoomInfoBg/NetIcon").GetComponent<Image>();
        ruleText = viewRoot.transform.Find("RoomInfoBg/Rule/Text").GetComponent<Text>();
        ruleText1 = viewRoot.transform.Find("RoomInfoBg/Rule/Text1").GetComponent<Text>();
        ruleText2 = viewRoot.transform.Find("RoomInfoBg/Rule/Text2").GetComponent<Text>();
        //touheIco = viewRoot.transform.FindChild("DownHead/touhe").gameObject;
        BackBtn = viewRoot.transform.Find("ChatView/BackBtn").GetComponent<Button>();
        BackItemPanel = viewRoot.transform.Find("ChatView/BackBtn/BackItemPanel").gameObject;
        ExitRoomBtn = viewRoot.transform.Find("ChatView/BackBtn/BackItemPanel/ExitRoomBtn").GetComponent<Button>();
        LeftRoomBtn = viewRoot.transform.Find("ChatView/BackBtn/BackItemPanel/LeftRoomBtn").GetComponent<Button>();

        ruleInfoBtn = viewRoot.transform.Find("ChatView/RuleInfoBtn").GetComponent<Button>();
        voiceBtn = viewRoot.transform.Find("ChatView/VoiceBtn").GetComponent<Button>();
        chatBtn = viewRoot.transform.Find("ChatView/ChatBtn").GetComponent<Button>();
        settingBtn = viewRoot.transform.Find("ChatView/SettingBtn").GetComponent<Button>();
        recordingIcon = viewRoot.transform.Find("ChatView/RecordingIcon").gameObject;

        downHead = viewRoot.transform.Find("DownHead").gameObject;
        leftHead = viewRoot.transform.Find("LeftHead").gameObject;
        rightHead = viewRoot.transform.Find("RightHead").gameObject;
        upHead = viewRoot.transform.Find("UpHead").gameObject;
        operateView = viewRoot.transform.Find("OperateView").GetComponent<OperateView>();
        canvasGroup = viewRoot.transform.GetComponent<CanvasGroup>();
        headItemList = new List<GameObject>();
        headItemList.Add(downHead);
        headItemList.Add(rightHead);
        headItemList.Add(upHead);
        headItemList.Add(leftHead);

        //readyBtn = viewRoot.transform.Find("ReadyBtn").gameObject.GetComponent<Button>();
        inviteBtn = viewRoot.transform.Find("InviteBtn").gameObject.GetComponent<Button>();
        reportView = viewRoot.transform.Find("ReportView").gameObject;

        TouHeBtn = viewRoot.transform.FindChild("OperateView/touhe").GetComponent<Button>();
        //BaoTingBtn = viewRoot.transform.FindChild("OperateView/baoting").GetComponent<Button>();
        PassBtn = viewRoot.transform.FindChild("OperateView/pass").GetComponent<Button>();
        BackBtn.onClick.AddListener(
            () => { if (BackItemPanel.activeSelf) BackItemPanel.SetActive(false); else BackItemPanel.SetActive(true); }
            );

        ApplicationFacade.Instance.RegisterMediator(new BattleViewMediator(Mediators.BATTLE_VIEW_MEDIATOR, this));

        battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
    }
Example #17
0
    // Use this for initialization
    void Start()
    {
        battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        //获取玩家节点
        var playerItem1 = transform.Find("PlayerItem1").GetComponent <DebugPlayerItem>();
        var playerItem2 = transform.Find("PlayerItem2").GetComponent <DebugPlayerItem>();
        var playerItem3 = transform.Find("PlayerItem3").GetComponent <DebugPlayerItem>();
        var playerItem4 = transform.Find("PlayerItem4").GetComponent <DebugPlayerItem>();

        playerItemArr.Add(playerItem1);
        playerItemArr.Add(playerItem2);
        playerItemArr.Add(playerItem3);
        playerItemArr.Add(playerItem4);
        playerItem1.selectCallBack     = SelctPlayerItem;
        playerItem2.selectCallBack     = SelctPlayerItem;
        playerItem3.selectCallBack     = SelctPlayerItem;
        playerItem4.selectCallBack     = SelctPlayerItem;
        playerItem1.returnCardCallBack = ReturnCard;
        playerItem2.returnCardCallBack = ReturnCard;
        playerItem3.returnCardCallBack = ReturnCard;
        playerItem4.returnCardCallBack = ReturnCard;
        //确定取消
        transform.Find("ConfirmBtn").GetComponent <Button>().onClick.AddListener(ConfirmSetCard);
        transform.Find("ClearBtn").GetComponent <Button>().onClick.AddListener(ClearCardSet);
        transform.Find("CloseBtn").GetComponent <Button>().onClick.AddListener(CloseCardSet);
        //牌面类型设置
        handCardToggle = transform.Find("HandCardToggle").GetComponent <Toggle>();
        getCardToggle  = transform.Find("GetCardToggle").GetComponent <Toggle>();
        nextCardToggle = transform.Find("NextCardToggle").GetComponent <Toggle>();
        handCardToggle.onValueChanged.AddListener((bool value) =>
        {
            if (value)
            {
                SelectToggle(handCardToggle);
            }
        });
        getCardToggle.onValueChanged.AddListener((bool value) =>
        {
            if (value)
            {
                SelectToggle(getCardToggle);
            }
        });
        nextCardToggle.onValueChanged.AddListener((bool value) =>
        {
            if (value)
            {
                SelectToggle(nextCardToggle);
            }
        });
        ApplicationFacade.Instance.RegisterMediator(new BattleDebugMediator(Mediators.DEBUG_MEDIATOR, this));
    }
Example #18
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();
    }
Example #19
0
    public void Init()
    {
        Player = new PlayerProxy();
        Player.Init();

        Login = new LoginProxy();
        Login.Init();

        Room = new RoomProxy();
        Room.Init();

        Battle = new BattleProxy();
        Battle.Init();
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_BATTLEINFOR packet = (GC_BATTLEINFOR )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            BattleProxy proxy = GameFacade.GetProxy <BattleProxy>();

            BattleProxy.SetBattleInfor(proxy.BattleInfor, packet);
            EventManager.GetInstance().SendEvent(EventId.ReceiveBattleInfor, packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Example #21
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_OBJPREPAREFORATTACK packet = (GC_OBJPREPAREFORATTACK )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            BattleProxy proxy = GameFacade.GetProxy <BattleProxy>();

            BattleProxy.SetPrepareForAttackInfor(proxy.PrepareForAttackInfor, packet);
            EventManager.GetInstance().SendEvent(EventId.ReceivePrepareForAttack, packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Example #22
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);
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_RET_USE_SKILL packet = (GC_RET_USE_SKILL )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            BattleProxy proxy = GameFacade.GetProxy <BattleProxy>();

            BattleProxy.SetUseSkill(proxy.UseSkill, packet);
            EventManager.GetInstance().SendEvent(EventId.ReceiveSkill, packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_OBJPOSLIST packet = (GC_OBJPOSLIST )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            BattleProxy proxy = GameFacade.GetProxy <BattleProxy>();

            BattleProxy.SetCurrentObjPos(proxy.CurrentObjPos, packet);
            EventManager.GetInstance().SendEvent(EventId.ReceiveSquadPosInfor, packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Example #25
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_OBJGETHURT packet = (GC_OBJGETHURT )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            BattleProxy proxy = GameFacade.GetProxy <BattleProxy>();

            BattleProxy.SetObjectGetHurt(proxy.ObjectGetHurt, packet);
            EventManager.GetInstance().SendEvent(EventId.ReceiveObjGetHurt, packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Example #26
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_OBJCOMMANDPURSUE packet = (GC_OBJCOMMANDPURSUE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            BattleProxy proxy = GameFacade.GetProxy <BattleProxy>();

            BattleProxy.SetPursueInfor(proxy.PursueInfor, packet);
            EventManager.GetInstance().SendEvent(EventId.ReceiveCommandPursue, packet);
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Example #27
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();
     }
 }
Example #28
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);
    }
Example #29
0
    // Use this for initialization
    void Start()
    {
        battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy;
        var actionBtn1 = transform.Find("ActionBtnContainer1/ActionBtn1").GetComponent <Button>();
        var actionBtn2 = transform.Find("ActionBtnContainer2/ActionBtn2").GetComponent <Button>();
        var actionBtn3 = transform.Find("ActionBtnContainer3/ActionBtn3").GetComponent <Button>();
        var actionBtn4 = transform.Find("ActionBtnContainer4/ActionBtn4").GetComponent <Button>();
        var actionBtn5 = transform.Find("ActionBtnContainer5/ActionBtn5").GetComponent <Button>();
        var actionBtn6 = transform.Find("ActionBtnContainer6/ActionBtn6").GetComponent <Button>();
        var actionBtn7 = transform.Find("ActionBtnContainer7/ActionBtn7").GetComponent <Button>();
        var actionBtn8 = transform.Find("ActionBtnContainer8/ActionBtn8").GetComponent <Button>();
        var actionBtn9 = transform.Find("ActionBtnContainer9/ActionBtn9").GetComponent <Button>();

        actionBtns          = new List <Button>();
        actionBtnContainers = new List <RectTransform>();
        actionBtns.Add(actionBtn1);
        actionBtns.Add(actionBtn2);
        actionBtns.Add(actionBtn3);
        actionBtns.Add(actionBtn4);
        actionBtns.Add(actionBtn5);
        actionBtns.Add(actionBtn6);
        actionBtns.Add(actionBtn7);
        actionBtns.Add(actionBtn8);
        actionBtns.Add(actionBtn9);
        actionBtns[0].onClick.AddListener(() => { ActHandler(0); });
        actionBtns[1].onClick.AddListener(() => { ActHandler(1); });
        actionBtns[2].onClick.AddListener(() => { ActHandler(2); });
        actionBtns[3].onClick.AddListener(() => { ActHandler(3); });
        actionBtns[4].onClick.AddListener(() => { ActHandler(4); });
        actionBtns[5].onClick.AddListener(() => { ActHandler(5); });
        actionBtns[6].onClick.AddListener(() => { ActHandler(6); });
        actionBtns[7].onClick.AddListener(() => { ActHandler(7); });
        actionBtns[8].onClick.AddListener(() => { ActHandler(8); });
        actionBtnContainers.Add(transform.Find("ActionBtnContainer1").GetComponent <RectTransform>());
        actionBtnContainers.Add(transform.Find("ActionBtnContainer2").GetComponent <RectTransform>());
        actionBtnContainers.Add(transform.Find("ActionBtnContainer3").GetComponent <RectTransform>());
        actionBtnContainers.Add(transform.Find("ActionBtnContainer4").GetComponent <RectTransform>());
        actionBtnContainers.Add(transform.Find("ActionBtnContainer5").GetComponent <RectTransform>());
        actionBtnContainers.Add(transform.Find("ActionBtnContainer6").GetComponent <RectTransform>());
        actionBtnContainers.Add(transform.Find("ActionBtnContainer7").GetComponent <RectTransform>());
        actionBtnContainers.Add(transform.Find("ActionBtnContainer8").GetComponent <RectTransform>());
        actionBtnContainers.Add(transform.Find("ActionBtnContainer9").GetComponent <RectTransform>());
        tingIcon = transform.Find("TingIcon").gameObject;
        UpdateTingIcon();
    }
Example #30
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();
    }