Пример #1
0
        private void OnCreateDragon(GameObject go)
        {
            uint drgnId   = A3_SlayDragonModel.getInstance().dicDragonData[currentSelectedDragonName].dragonId;
            int  diff_lvl = A3_SlayDragonModel.getInstance().GetUnlockedDiffLv();

            A3_SlayDragonProxy.getInstance().SendCreate(drgnId, diff_lvl);
        }
Пример #2
0
 public override void onClosed()
 {
     A3_SlayDragonProxy.getInstance().removeEventListener(A3_SlayDragonProxy.END_TIME, OnRefreshTime);
     OnDragonLineClick(rootDragonList.GetChild(0).gameObject);
     CancelInvoke("RunTimer");
     isFrstdrgnInit = false;
     Instance       = null;
 }
Пример #3
0
 public override void onShowed()
 {
     Instance = this;
     A3_SlayDragonProxy.getInstance().addEventListener(A3_SlayDragonProxy.END_TIME, OnRefreshTime);
     if (!IsInvoking("RunTimer"))
     {
         InvokeRepeating("RunTimer", 0f, 1f);
     }
     // if (!PlayerModel.getInstance().inFb) //副本中不发送协议
     Invoke("ShowFirstDragon", 0.2f);
     A3_SlayDragonProxy.getInstance().SendGetData();
 }
Пример #4
0
 private void OnGoToSlayDragon(GameObject go)
 {
     if (A3_LegionModel.getInstance().myLegion.clanc < 3 && !A3_SlayDragonModel.getInstance().GetUnlockedDragonData().isOpened)
     {
         flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_noopen"));
         return;
     }
     if (0 != A3_SlayDragonModel.getInstance().GetUnlockedDragonId())
     {
         isOnMoveOpt = true;
         A3_SlayDragonProxy.getInstance().SendGo();
     }
     else
     {
         flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_jf"));
     }
 }
Пример #5
0
        private void OnGive(GameObject go)
        {
            uint       unlockedDragonId = 0;
            DragonData curDrgnData      = A3_SlayDragonModel.getInstance().dicDragonData[currentSelectedDragonName];

            if (0 != (unlockedDragonId = A3_SlayDragonModel.getInstance().GetUnlockedDragonId()) && unlockedDragonId == curDrgnData.dragonId)
            {
                uint itemId = A3_SlayDragonModel.getInstance().GetDragonKeyId();
                if (0 != itemId)
                {
                    if (0 < a3_BagModel.getInstance().getItemNumByTpid(itemId))
                    {
                        if (curDrgnData.proc < A3_SlayDragonModel.getInstance().GetCost())
                        {
                            A3_SlayDragonProxy.getInstance().SendGive();
                        }
                        else
                        {
                            flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_can"));
                        }
                    }
                    else
                    {
                        ArrayList data = new ArrayList();
                        data.Add(a3_BagModel.getInstance().getItemDataById(itemId));
                        InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data);
                    }
                }
            }
            else
            {
                if (A3_LegionModel.getInstance().myLegion.clanc < 3)
                {
                    flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_jf"));
                }
                else
                {
                    flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_please"));
                }
            }
        }
Пример #6
0
 private void OnUnlockDragon(GameObject go)
 {
     if (A3_LegionModel.getInstance().myLegion.clanc >= 3)
     {
         if (currentSelectedDragonName != null)
         {
             DragonData dragonData = A3_SlayDragonModel.getInstance().dicDragonData[currentSelectedDragonName];
             if (!dragonData.isUnlcoked && 0 == A3_SlayDragonModel.getInstance().GetUnlockedDragonId())
             {
                 A3_SlayDragonProxy.getInstance().SendUnlock(dragonData.dragonId);
             }
             else
             {
                 flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_nomany"));
             }
         }
     }
     else
     {
         flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_kustllx"));
     }
 }
Пример #7
0
        public override void init()
        {
            #region 初始化汉字
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1201").text            = ContMgr.getCont("A3_SlayDragon_0");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1201/title_text").text = ContMgr.getCont("A3_SlayDragon_1");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1202").text            = ContMgr.getCont("A3_SlayDragon_2");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1202/title_text").text = ContMgr.getCont("A3_SlayDragon_3");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1203").text            = ContMgr.getCont("A3_SlayDragon_4");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1203/title_text").text = ContMgr.getCont("A3_SlayDragon_5");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1204").text            = ContMgr.getCont("A3_SlayDragon_6");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1204/title_text").text = ContMgr.getCont("A3_SlayDragon_7");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1205").text            = ContMgr.getCont("A3_SlayDragon_8");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1205/title_text").text = ContMgr.getCont("A3_SlayDragon_9");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1206").text            = ContMgr.getCont("A3_SlayDragon_10");
            getComponentByPath <Text>("bg/dragon_opt/descBg/desc/1206/title_text").text = ContMgr.getCont("A3_SlayDragon_11");
            getComponentByPath <Text>("bg/dragon_opt/proc_unlock/proc_desc").text       = ContMgr.getCont("A3_SlayDragon_12");
            getComponentByPath <Text>("bg/dragon_opt/timer/desc").text                  = ContMgr.getCont("A3_SlayDragon_13");
            getComponentByPath <Text>("bg/dragon_opt/reward/text").text                 = ContMgr.getCont("A3_SlayDragon_14");
            getComponentByPath <Text>("bg/dragon_opt/btn_do/Go/text_img/Text").text     = ContMgr.getCont("A3_SlayDragon_15");
            getComponentByPath <Text>("bg/dragon_opt/btn_do/Create/text_img/Text").text = ContMgr.getCont("A3_SlayDragon_15");
            getComponentByPath <Text>("bg/dragon_opt/btn_do/Unlock/text_img/Text").text = ContMgr.getCont("A3_SlayDragon_16");
            getComponentByPath <Text>("hp/help_txt/desc/title").text = ContMgr.getCont("A3_SlayDragon_17");
            getComponentByPath <Text>("hp/help_txt/desc/dc").text    = ContMgr.getCont("A3_SlayDragon_18");
            #endregion


            Instance       = this;
            rootDragonList = transform.FindChild("bg/dragon_list/rect_mask/rect_scroll");
            for (int i = 0; i < rootDragonList.childCount; i++)
            {
                Transform tfDragonLine = rootDragonList.GetChild(i);
                A3_SlayDragonModel.getInstance().dicDragonName[i] = tfDragonLine.name;
                new BaseButton(tfDragonLine).onClick = OnDragonLineClick;
            }
            goDragonHelpTxt = transform.FindChild("hp/help_txt").gameObject;
            goTimer         = transform.FindChild("bg/dragon_opt/timer").gameObject;
            txtTimer        = goTimer.transform.FindChild("time").GetComponent <Text>();
            new BaseButton(transform.FindChild("bg/dragon_opt/btn_do/Go")).onClick            = OnGoToSlayDragon;
            new BaseButton(transform.FindChild("bg/dragon_opt/btn_do/Unlock")).onClick        = OnUnlockDragon;
            new BaseButton(transform.FindChild("bg/dragon_opt/btn_do/Create")).onClick        = (go) => { OnCreateDragon(go); OnGoToSlayDragon(go); };
            new BaseButton(transform.FindChild("bg/dragon_opt/proc_unlock/btn_give")).onClick = OnGive;
            new BaseButton(transform.FindChild("close")).onClick = (go) => InterfaceMgr.getInstance().close(InterfaceMgr.A3_SLAY_DRAGON);
            new BaseButton(transform.FindChild("hp")).onClick    = (go) => goDragonHelpTxt.SetActive(true);
            new BaseButton(goDragonHelpTxt.transform.FindChild("close_area")).onClick = (go) => goDragonHelpTxt.SetActive(false);
            rootDragonOpt = transform.FindChild("bg/dragon_opt");
            new BaseButton(rootDragonOpt.FindChild("reward/reward_icon")).onClick = (go) =>
            {
                uint dragonId = A3_SlayDragonModel.getInstance().dicDragonData[currentSelectedDragonName].dragonId;
                uint itemId   = A3_SlayDragonModel.getInstance().GetRewardIdByDragonId(dragonId);
                if (itemId == 0)
                {
                    return;
                }
                ArrayList arr = new ArrayList();
                arr.Add(itemId);
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr);
            };

            A3_SlayDragonProxy.getInstance().addEventListener(A3_SlayDragonProxy.REFRESH, OnRefresh);
            A3_SlayDragonProxy.getInstance().addEventListener(A3_SlayDragonProxy.OPEN_LVL, OnOpenLvl);
        }
Пример #8
0
        public override void init()
        {
            Instance     = this;
            tfParentWait = transform.FindChild("wait");
            tfParentWait.gameObject.SetActive(false);
            imgProcess = tfParentWait.FindChild("waitBG").GetComponent <Image>();
            (BtnWait = new BaseButton(tfParentWait.FindChild("waitBG/btnDoWait"))).onClick = OnWaitBtnClick;
            actionImage = tfParentWait.FindChild("waitBG/btnDoWait").GetComponent <Image>();
            winKillMon  = transform.FindChild("killmon").gameObject;
            winKillMon.SetActive(false);
            winKillDragon = transform.FindChild("killDragon").gameObject;
            winKillDragon.SetActive(false);
            tfSubmitItem        = transform.FindChild("submitItem");
            tfSubmitItemMainCon = tfSubmitItem.FindChild("mask/scrollview/rect");
            tfSubmitItemCon     = tfSubmitItem.FindChild("mask/scrollview/rect/con");
            tfFocus             = tfSubmitItem.FindChild("focus");
            tfFocus.gameObject.SetActive(false);
            tfSubmitItem.gameObject.SetActive(false);
            tfBtnStart = winKillMon.transform.FindChild("btnStart");
            Transform tfBtnCancel = winKillMon.transform.FindChild("btnDontStart");

            new BaseButton(tfBtnStart).onClick  = OnStartBtnClick;
            new BaseButton(tfBtnCancel).onClick = OnCancelBtnClick;
            new BaseButton(transform.FindChild("submitItem/closeBtn")).onClick = (btnClose) => tfSubmitItem.gameObject.SetActive(false);
            new BaseButton(transform.FindChild("killmon/closeArea")).onClick   = (go) => go.transform.parent.gameObject.SetActive(false);
            new BaseButton(tfSubmitItem.FindChild("btnOK")).onClick            = (go) =>
            {
                if (submitItemIId != 0 && curTaskId != 0)
                {
                    A3_TaskProxy.getInstance().SendSubmit(curTaskId, submitItemIId);
                }
                tfSubmitItem.gameObject.SetActive(false);
            };
            //transform.SetParent(skillbar.instance.transform);
            A3_TaskProxy.getInstance().addEventListener(A3_TaskProxy.ON_TASK_REFRESH, OnCheck);
            A3_TaskProxy.getInstance().addEventListener(A3_TaskProxy.ON_GET_NEW_TASK, OnCheck);

            taskOptElement = new Dictionary <int, TaskOptElement>();
            Dictionary <int, TaskData> listTask = A3_TaskModel.getInstance().GetDicTaskData();
            List <int> idx = new List <int>(listTask.Keys);

            for (int i = 0; i < idx.Count; i++)
            {
                int taskId = idx[i];
                if (listTask[taskId].release_tm > 0)
                {
                    if (listTask[taskId].lose_tm > muNetCleint.instance.CurServerTimeStamp)
                    {
                        taskOptElement[taskId] =
                            new TaskOptElement(taskId,
                                               isKeepingKillMon: true,
                                               isTaskMonsterAlive: true //,
                                                                        //timeKillTerminal: A3_TaskModel.getInstance().GetTaskDataById(taskId).lose_tm
                                               );
                        taskOptElement[taskId].InitUi(
                            liteMinimapTaskTimer: a3_liteMinimap.instance.GetTaskPage(taskId)?.transform.FindChild("name/timer").GetComponent <Text>()
                            );
                    }
                }
            }
            Instance.name         = "A3_TaskOpt";
            waitThresholdDistance = XMLMgr.instance.GetSXML("task.range").getFloat("action_range") / GameConstant.PIXEL_TRANS_UNITYPOS;
            scaleIcon             = transform.FindChild("submitItem/iconConfig")?.localScale ?? Vector3.zero;
            new BaseButton(winKillDragon.transform.FindChild("btnStart")).onClick = (go) =>
            {
                uint dragonId = A3_SlayDragonModel.getInstance().GetUnlockedDragonId();
                int  diffLv   = A3_SlayDragonModel.getInstance().GetUnlockedDiffLv();
                A3_SlayDragonProxy.getInstance().SendGo();
            };
            new BaseButton(winKillDragon.transform.FindChild("btnNope")).onClick = (go) => winKillDragon.SetActive(false);
            if (!IsInvoking("RunTimer"))
            {
                InvokeRepeating("RunTimer", 0f, 1.0f);
            }



            getComponentByPath <Text>("killmon/bg/desc").text           = ContMgr.getCont("A3_TaskOpt_0");
            getComponentByPath <Text>("killmon/btncreatteam/Text").text = ContMgr.getCont("A3_TaskOpt_1");
            getComponentByPath <Text>("killmon/btnDontStart/Text").text = ContMgr.getCont("A3_TaskOpt_2");
            getComponentByPath <Text>("killmon/btnStart/Text").text     = ContMgr.getCont("A3_TaskOpt_3");
            getComponentByPath <Text>("wait/action_text").text          = ContMgr.getCont("A3_TaskOpt_4");
            getComponentByPath <Text>("submitItem/title/Text").text     = ContMgr.getCont("A3_TaskOpt_5");
            getComponentByPath <Text>("submitItem/btnOK/text").text     = ContMgr.getCont("A3_TaskOpt_6");
            getComponentByPath <Text>("killDragon/bg/desc").text        = ContMgr.getCont("A3_TaskOpt_7");
            getComponentByPath <Text>("killDragon/btnStart/Text").text  = ContMgr.getCont("A3_TaskOpt_8");
            getComponentByPath <Text>("killDragon/btnNope/Text").text   = ContMgr.getCont("A3_TaskOpt_2");
        }