Esempio n. 1
0
        public static void showTeachWin(object[] objs, Action forceDO, int cameraType = 0)
        {
            GameObject trans = GameObject.Find(objs[1] as string);

            if (trans == null)
            {
                // Time.timeScale = 0;
                Debug.LogError("新手脚本错误:找不到该元件:" + objs[1]);
                NewbieModel.getInstance().hide();
                return;
            }

            RectTransform rect = trans.transform.GetComponent <RectTransform>();

            if (objs.Length == 3)
            {
                NewbieModel.getInstance().show(rect.position, rect.sizeDelta, objs[2] as string, false, "", null, cameraType);
            }
            else if (objs.Length == 4)
            {
                NewbieModel.getInstance().show(rect.position, rect.sizeDelta, objs[2] as string, cameraType == 1, objs[3] as string, forceDO, cameraType);
            }
            else if (objs.Length == 5)
            {
                NewbieModel.getInstance().show(rect.position, rect.sizeDelta, objs[2] as string, cameraType == 1, objs[3] as string, forceDO, cameraType, int.Parse(objs[4] as string) != 1);
            }
        }
Esempio n. 2
0
        private void onBtnClicks(GameObject go)
        {
            BaseProxy <a3_PkmodelProxy> .getInstance().sendProxy(int.Parse(go.name));

            InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMODEL);
            NewbieModel.getInstance().hide();
        }
Esempio n. 3
0
        public void RunTask(TaskData taskData = null, bool checkNextStep = false, bool checkItem = false, bool clickAuto = false)
        {
            if (stopAuto)
            {
                return;
            }
            //新手指引屏蔽自动寻路任务
            if (NewbieModel.getInstance().curItem != null && NewbieModel.getInstance().curItem.showing)
            {
                return;
            }


            if (taskData == null && A3_TaskModel.getInstance().main_task_id > 0)
            {
                taskData = A3_TaskModel.getInstance().GetTaskDataById(A3_TaskModel.getInstance().main_task_id);
            }
            if (taskData == null)
            {
                return;
            }
            A3_TaskModel.getInstance().curTask = taskData;
            executeTask = taskData;
            if (executeTask == null)
            {
                return;
            }


            //clickAuto为点击前往。必须执行
            Execute(executeTask, checkNextStep, checkItem, clickAuto);
        }
        private void initBoard()
        {
            //lucisa 临时屏蔽新手指引

            NewbieModel.getInstance();
            NewbieModel.getInstance().initNewbieData();
            //lguiBoard.initBoard();
        }
Esempio n. 5
0
		public bool doit(bool byforce = false, bool fromHandle = false)
		{
			bool flag = this.check(fromHandle) || (byforce && this is NbStop) || this is NbGo;
			bool result;
			if (flag)
			{
				bool flag2 = this.idx == 0;
				if (flag2)
				{
					NewbieModel.getInstance().first_show = true;
					bool flag3 = this.id == 1;
					if (flag3)
					{
						InterfaceMgr.getInstance().closeAllWin(InterfaceMgr.DIALOG);
					}
					bool flag4 = this.id == 11;
					if (flag4)
					{
						ModelBase<LotteryModel>.getInstance().isNewBie = true;
					}
					bool flag5 = this.id == 14;
					if (flag5)
					{
						InterfaceMgr.getInstance().closeAllWin("");
					}
					InterfaceMgr.getInstance().closeFui_NB();
					this.save();
				}
				else
				{
					NewbieModel.getInstance().first_show = false;
				}
				this.removeListener();
				this.addedLinstener = false;
				this.doTeach();
				bool flag6 = this.nextItem != null;
				if (flag6)
				{
					this.nextItem.doit(false, false);
				}
				result = true;
			}
			else
			{
				bool flag7 = !this.addedLinstener;
				if (flag7)
				{
					this.addedLinstener = true;
					this.addListener();
				}
				result = false;
			}
			return result;
		}
Esempio n. 6
0
        public void showWithoutAvatar(Vector3 pos, Vector2 size, string clickItemName = "", Action clickMaskHandle = null)
        {
            a3_task_auto.instance.stopAuto = true;

            if (showing == true)
            {
                return;
            }
            showing = true;
            goBg.SetActive(true);
            txt.gameObject.SetActive(false);
            txtBg.gameObject.SetActive(false);
            goNext.SetActive(false);

            showMarkClick();

            _clickItemName   = clickItemName;
            _clickMaskHandle = clickMaskHandle;

            // rect.position = pos;
            if (NewbieModel.getInstance().first_show)
            {
                bg.position = pos;
                NewbieModel.getInstance().first_show = false;
            }
            else
            {
                bg.DOMove(pos, 0.6f).OnComplete(() => { goMask.SetActive(true); });
            }
            goNext.transform.localPosition = new Vector3(-rect.localPosition.x, -rect.localPosition.y, 0);


            Vector3 vec = rectUp.localPosition;

            vec.y = 1000 + size.y / 2;
            rectUp.localPosition = vec;

            vec   = rectDown.localPosition;
            vec.y = -1000 - size.y / 2;
            rectDown.localPosition = vec;

            vec   = rectRight.localPosition;
            vec.x = -1000 - size.x / 2;
            rectRight.localPosition = vec;
            Vector2 v2 = new Vector2(2000, size.y);

            rectRight.sizeDelta = v2;
            rectleft.sizeDelta  = v2;

            vec   = rectleft.localPosition;
            vec.x = 1000 + size.x / 2;
            rectleft.localPosition = vec;
        }
Esempio n. 7
0
        public static void showWithClick(object[] objs, Action forceDo)
        {
            GameObject trans = GameObject.Find(objs[1] as string);

            if (trans == null)
            {
                Debug.LogError("新手脚本错误:找不到该元件:" + objs[1]);
                NewbieModel.getInstance().hide();
                return;
            }
            NewbieModel.getInstance().showTittle(objs[1] as string, forceDo);
        }
Esempio n. 8
0
        public void onLoadInfo(Variant data)
        {
            debug.Log("pk模式的信息:" + data.dump());
            bool flag = data.ContainsKey("pk_state");

            if (flag)
            {
                ModelBase <PlayerModel> .getInstance().now_pkState = data["pk_state"];

                switch (ModelBase <PlayerModel> .getInstance().now_pkState)
                {
                case 0:
                    ModelBase <PlayerModel> .getInstance().pk_state = PK_TYPE.PK_PEACE;

                    break;

                case 1:
                    ModelBase <PlayerModel> .getInstance().pk_state = PK_TYPE.PK_PKALL;

                    ModelBase <PlayerModel> .getInstance().m_unPK_Param = ModelBase <PlayerModel> .getInstance().cid;

                    ModelBase <PlayerModel> .getInstance().m_unPK_Param2 = ModelBase <PlayerModel> .getInstance().cid;

                    break;

                case 2:
                    ModelBase <PlayerModel> .getInstance().pk_state = PK_TYPE.PK_TEAM;

                    ModelBase <PlayerModel> .getInstance().m_unPK_Param = ModelBase <PlayerModel> .getInstance().teamid;

                    ModelBase <PlayerModel> .getInstance().m_unPK_Param2 = ModelBase <PlayerModel> .getInstance().clanid;

                    break;
                }
                bool flag2 = a3_pkmodel._instance;
                if (flag2)
                {
                    a3_pkmodel._instance.ShowThisImage(data["pk_state"]);
                }
                bool flag3 = SelfRole.s_LockFX.gameObject != null;
                if (flag3)
                {
                    PkmodelAdmin.RefreshShow(SelfRole._inst.m_LockRole, false, false);
                }
                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modPkState", "model/PlayerModel", new object[]
                {
                    ModelBase <PlayerModel> .getInstance().now_pkState,
                    true
                });
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMODEL);
                NewbieModel.getInstance().hide();
            }
        }
Esempio n. 9
0
        void onBtnClicks(GameObject go)
        {
            //for (int i = 0; i < objs.Length; i++)
            //{
            //    objs[i].transform.FindChild("bg/"+i).gameObject.SetActive(true);

            //}
            //go.SetActive(false);
            //go.transform.parent.transform.FindChild("now_txt").gameObject.SetActive(true);
            a3_PkmodelProxy.getInstance().sendProxy(int.Parse(go.name));
            InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMODEL);
            NewbieModel.getInstance().hide();
        }
Esempio n. 10
0
        public static void showWithNext(object[] objs, Action forceDo)
        {
            GameObject trans = GameObject.Find(objs[1] as string);

            if (trans == null)
            {
                Debug.LogError("新手脚本错误:找不到该元件:" + objs[1]);
                NewbieModel.getInstance().hide();
                return;
            }
            RectTransform rect = trans.transform.GetComponent <RectTransform>();

            NewbieModel.getInstance().showNext(rect.position, rect.sizeDelta, objs[2] as string, int.Parse(objs[3].ToString()), forceDo);
        }
        public void play()
        {
            if (bga == null)
            {
                init();
            }

            //     MediaClient.getInstance().PlayMusicUrl("");
            NewbieModel.getInstance().hide();

            Randombg();
            onAniOver();
            RandomTip();
            PlayLoading();
        }
Esempio n. 12
0
        void task_auto_click()
        {
            if (task_data != null)
            {
                if (task_data.taskT == TaskType.MAIN && NewbieModel.getInstance().curItem != null && NewbieModel.getInstance().curItem.showing)
                {
                    return;
                }
            }

            if (BtnWait.interactable == true && tfParentWait.gameObject.activeSelf && imgProcess.fillAmount == 0)
            {
                OnWaitBtnClick(BtnWait.gameObject);
            }
        }
Esempio n. 13
0
        public static void showWithOutClick(object[] objs, Action forceDo)
        {
            GameObject trans = GameObject.Find(objs[1] as string);

            if (trans == null)
            {
                Debug.LogError("新手脚本错误:找不到该元件:" + objs[1]);
                NewbieModel.getInstance().hide();
                return;
            }

            RectTransform rect = trans.transform.GetComponent <RectTransform>();

            NewbieModel.getInstance().show(rect.position, rect.sizeDelta, objs[2] as string, false, objs[3] as string, null, 0);
            NewbieModel.getInstance().curItem.hideMarkClick();
        }
        public void onLoadInfo(Variant data)
        {
            debug.Log("pk模式的信息:" + data.dump());
            if (data.ContainsKey("pk_state"))
            {
                PlayerModel.getInstance().now_pkState = data["pk_state"];
                switch (PlayerModel.getInstance().now_pkState)
                {
                case 0:
                    PlayerModel.getInstance().pk_state = PK_TYPE.PK_PEACE;
                    break;

                case 1:
                    PlayerModel.getInstance().pk_state      = PK_TYPE.PK_PKALL;
                    PlayerModel.getInstance().m_unPK_Param  = PlayerModel.getInstance().cid;
                    PlayerModel.getInstance().m_unPK_Param2 = PlayerModel.getInstance().cid;
                    break;

                case 2:
                    PlayerModel.getInstance().pk_state      = PK_TYPE.PK_TEAM;
                    PlayerModel.getInstance().m_unPK_Param  = PlayerModel.getInstance().teamid;
                    PlayerModel.getInstance().m_unPK_Param2 = PlayerModel.getInstance().clanid;
                    break;
                    //case 3:
                    //    PlayerModel.getInstance().pk_state = PK_TYPE.PK_LEGION;
                    //    PlayerModel.getInstance().m_unPK_Param = PlayerModel.getInstance().clanid;
                    //    break;
                    //case 4:
                    //    PlayerModel.getInstance().pk_state = PK_TYPE.PK_HERO;
                    //    //???
                    //    break;
                }
                if (a3_pkmodel._instance)
                {
                    a3_pkmodel._instance.ShowThisImage(data["pk_state"]);
                }
                if (SelfRole.s_LockFX.gameObject != null)
                {
                    PkmodelAdmin.RefreshShow(SelfRole._inst.m_LockRole);
                }

                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modPkState", "model/PlayerModel", PlayerModel.getInstance().now_pkState, true);

                InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMODEL);
                NewbieModel.getInstance().hide();
            }
        }
Esempio n. 15
0
        public override void onShowed()
        {
            transform.SetAsLastSibling();
            instance = this;
            NetClient.instance.addEventListener(GAME_EVENT.CONN_ERR, onError);

            //getGameObjectByPath("info/line").SetActive(showLine);
            //showLine = false;

            setErrorType(ERROR_TYPE_DISCONNECT);

            base.onShowed();

            if (a3_wing_skin.instance != null)
            {
                a3_wing_skin.instance.wingAvatar.SetActive(false);
            }
            //if (a3_summon.instan && a3_summon.instan.m_selectedSummon)
            //{
            //    a3_summon.instan.m_selectedSummon.SetActive(false);
            //}
            if (a3_summon_new.getInstance)
            {
                //for (int i = 0;i< a3_summon_new.getInstance.Avatorlist.Count;i++)
                //{
                //    if (a3_summon_new.getInstance.Avatorlist[i] != null&& a3_summon_new.getInstance.Avatorlist[i].activeSelf)
                //    {
                //        a3_summon_new.getInstance.Avatorlist[i].SetActive(false);
                //    }
                //}
                if (a3_summon_new.getInstance.avatorobj != null)
                {
                    a3_summon_new.getInstance.avatorobj.SetActive(false);
                }
                if (a3_summon_new.getInstance.avator_look != null)
                {
                    a3_summon_new.getInstance.avator_look.SetActive(false);
                }
            }

            NewbieModel.getInstance().hide();

            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_DIS_CONECT);
        }
Esempio n. 16
0
        public override void onShowed()
        {
            base.transform.SetAsLastSibling();
            disconect.instance = this;
            NetClient.instance.addEventListener(3013u, new Action <GameEvent>(this.onError));
            this.setErrorType(disconect.ERROR_TYPE_DISCONNECT);
            base.onShowed();
            bool flag = a3_wing_skin.instance != null;

            if (flag)
            {
                a3_wing_skin.instance.wingAvatar.SetActive(false);
            }
            bool flag2 = a3_summon.instan && a3_summon.instan.m_selectedSummon;

            if (flag2)
            {
                a3_summon.instan.m_selectedSummon.SetActive(false);
            }
            NewbieModel.getInstance().hide();
            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_DIS_CONECT);
        }
Esempio n. 17
0
 public static void hideTeachWin(object[] objs, Action forceDo)
 {
     NewbieModel.getInstance().hide();
 }
Esempio n. 18
0
        public bool doit(bool byforce = false, bool fromHandle = false)
        {
            if (check(fromHandle) || (byforce && this is NbStop) || this is NbGo)
            {
                if (idx == 0)
                {
                    NewbieModel.getInstance().first_show = true;
                    if (a3_liteMinimap.instance)
                    {
                        a3_liteMinimap.instance.changeCtr_NB();
                    }

                    if (id == 1)
                    {
                        InterfaceMgr.getInstance().closeAllWin(InterfaceMgr.DIALOG);
                    }

                    if (id == 11)
                    {
                        LotteryModel.getInstance().isNewBie = true;
                    }
                    //else if (id == 8)
                    if (id == 14)
                    {
                        //InterfaceMgr.getInstance().closeAllWin(InterfaceMgr.FB_3D);
                        //else
                        //InterfaceMgr.getInstance().closeAllWin(InterfaceMgr.FB_WIN);
                        //if(idx != 8)
                        InterfaceMgr.getInstance().closeAllWin();
                    }

                    if (id == 15)
                    {
                        a3_BagModel.getInstance().jilu.Clear();
                    }
                    InterfaceMgr.getInstance().closeFui_NB();
                    save();
                }
                else
                {
                    NewbieModel.getInstance().first_show = false;
                }
                removeListener();
                // NewbieModel.getInstance().hide();

                //  curId = id;
                addedLinstener = false;
                doTeach();


                if (nextItem != null)
                {
                    nextItem.doit();
                }
                //else
                //    curId = -1;
                return(true);
            }
            else if (addedLinstener == false)
            {
                //if (!l.Contains(this))
                //    l.Add(this);

                addedLinstener = true;
                addListener();
            }
            return(false);
        }
Esempio n. 19
0
        public override void onShowed()
        {
            closeWindow();
            instans = this;
            this.transform.FindChild("btn_gld/Text_free").gameObject.SetActive(false);
            this.transform.FindChild("btn_stone/Text_free").gameObject.SetActive(false);
            recharge.SetActive(false);
            InterfaceMgr.getInstance().floatUI.localScale = Vector3.zero;
            if (GameObject.Find("GAME_CAMERA/myCamera"))
            {
                GameObject cameraOBJ = GameObject.Find("GAME_CAMERA/myCamera");
                if (!cameraOBJ.GetComponent <DeathShader>())
                {
                    cameraOBJ.AddComponent <DeathShader>();
                }
                else
                {
                    cameraOBJ.GetComponent <DeathShader>().enabled = true;
                }
            }
            //timer = 0;
            //origin_tm = 3;
            here_time = 30;
            jdzc_time = Xml_jdzc.getInt("revive");
            btn_gld.gameObject.SetActive(false);
            btn_stone.gameObject.SetActive(false);
            btn_backleft.gameObject.SetActive(false);
            btn_backmid.gameObject.SetActive(false);
            spost_relive.gameObject.SetActive(false);
            //btn_stone.interactable = false;
            //btn_gld.interactable = false;
            //btn_backmid.interactable = false;
            //btn_backleft.interactable = false;

            RefreshBackTownBtn();
            if (!PlayerModel.getInstance().inFb)
            {
                RefreshOriginBtn();
            }

            if (CanReviveOrigin() == 0)
            {//地图不允许原地复活
                btn_backmid.gameObject.SetActive(true);
            }
            else if (CanReviveOrigin() == 1)
            {
                if (HasRespawnStone())
                {
                    btn_stone.gameObject.SetActive(true);
                    btn_backleft.gameObject.SetActive(true);
                }
                else
                {
                    btn_gld.gameObject.SetActive(true);
                    btn_backleft.gameObject.SetActive(true);
                }
            }
            else if (CanReviveOrigin() == 3)
            {
                //不可复活,自动本场景复活点复活
                spost_relive.gameObject.SetActive(true);
            }

            // BattleProxy.getInstance().addEventListener(BattleProxy.EVENT_DIE, refInfo);

            if (uiData != null)
            {
                one = (BaseRole)uiData[0];
            }
            refInfo();
            InterfaceMgr.getInstance().closeAllWin(InterfaceMgr.A3_RELIVE);

            if (A3_SummonModel.getInstance().GetSummons().ContainsKey(A3_SummonModel.getInstance().nowShowAttackID))
            {
                A3_SummonModel.getInstance().toAttackID = A3_SummonModel.getInstance().nowShowAttackID;
                A3_SummonProxy.getInstance().sendZhaohui();
            }

            NewbieModel.getInstance().hide();
        }
Esempio n. 20
0
        public void show(Vector3 pos, Vector2 size, string text = "", bool force = false, string clickItemName = "", Action clickMaskHandle = null, int cameraType = 0, bool autoClose = true)
        {
            a3_task_auto.instance.stopAuto = true;

            if (showing == true)
            {
                return;
            }
            showing = true;
            goBg.SetActive(true);
            goNext.SetActive(false);
            txt.gameObject.SetActive(true);
            txtBg.gameObject.SetActive(true);
            txt.text = text;

            showMarkClick();

            // rect.position = pos;
            //if (force)
            //{
            //    rect.position = pos;
            //}
            //else
            //{
            // rect.position = pos;
            if (NewbieModel.getInstance().first_show)
            {
                bg.position = pos;
                NewbieModel.getInstance().first_show = false;
            }
            else
            {
                bg.DOMove(pos, 0.6f).OnComplete(() => { goMask.SetActive(true); });
            }
            //}
            _clickItemName = clickItemName;
            //if (clickItemName != "")
            //goMask.SetActive(true);
            //else
            //    goMask.SetActive(false);

            _autoClose         = autoClose;
            _clickMaskHandle   = clickMaskHandle;
            rectMask.sizeDelta = size;


            DoAfterMgr.instacne.addAfterRender(() =>
            {
                //InterfaceMgr.getInstance().close(InterfaceMgr.GETTING);
                //InterfaceMgr.getInstance().close(InterfaceMgr.UPLEVEL);
            });



            //float tempx = size.x / 2 + 130f;
            //if (pos.x > Baselayer.halfuiWidth || cameraType == 1)
            //{
            //    txtBg.localScale = Vector3.one;
            //    tempx = -tempx;
            //}
            //else
            //{
            //    txtBg.localScale = new Vector3(-1, 1, 1);
            //}

            //float tempy = 60;
            //if (pos.y > 0)
            //    tempy = -60;

            //if (clickItemName == "dialog(Clone)")
            //    rectTxtCon.localPosition = new Vector3(-tempx / 2, tempy + 140f);
            //else if (clickItemName == "btn_get")
            //    rectTxtCon.localPosition = new Vector3(tempx + 190f, tempy + 40f);
            //else
            //    rectTxtCon.localPosition = new Vector3(tempx, tempy);


            Vector3 vec = rectUp.localPosition;

            vec.y = 1000 + size.y / 2;
            rectUp.localPosition = vec;

            vec   = rectDown.localPosition;
            vec.y = -1000 - size.y / 2;
            rectDown.localPosition = vec;

            vec   = rectRight.localPosition;
            vec.x = -1000 - size.x / 2;
            rectRight.localPosition = vec;
            Vector2 v2 = new Vector2(2000, size.y);

            rectRight.sizeDelta = v2;
            rectleft.sizeDelta  = v2;

            vec   = rectleft.localPosition;
            vec.x = 1000 + size.x / 2;
            rectleft.localPosition = vec;

            if (pos.x > Baselayer.halfuiWidth)
            {
                createAvatar(true);
            }
            else
            {
                createAvatar(false);
            }
        }
Esempio n. 21
0
        public void showNext(Vector3 pos, Vector2 size, string text = "", int type = 0, Action clickMaskHandle = null)
        {
            a3_task_auto.instance.stopAuto = true;

            if (showing == true)
            {
                return;
            }
            showing = true;
            goBg.SetActive(true);
            goNext.SetActive(true);
            txt.gameObject.SetActive(false);
            txtBg.gameObject.SetActive(false);
            goNextTxt.text = text;

            hideMarkClick();

            _clickMaskHandle = clickMaskHandle;

            // rect.position = pos;
            if (NewbieModel.getInstance().first_show)
            {
                bg.position = pos;
                NewbieModel.getInstance().first_show = false;
            }
            else
            {
                bg.DOMove(pos, 0.6f).OnComplete(() => { goMask.SetActive(true); });
            }
            goNext.transform.localPosition = new Vector3(-rect.localPosition.x, -rect.localPosition.y, 0);

            rectMask.sizeDelta = size;

            //float tempx = size.x / 2 + 130f;
            //if (pos.x > Baselayer.halfuiWidth)
            //{
            //    txtBg.localScale = Vector3.one;
            //    tempx = -tempx;
            //}
            //else
            //{
            //    txtBg.localScale = new Vector3(-1, 1, 1);
            //}

            //float tempy = 60;
            //if (pos.y > 0)
            //    tempy = -60;


            //rectTxtCon.localPosition = new Vector3(tempx, tempy);

            Vector3 vec = rectUp.localPosition;

            vec.y = 1000 + size.y / 2;
            rectUp.localPosition = vec;

            vec   = rectDown.localPosition;
            vec.y = -1000 - size.y / 2;
            rectDown.localPosition = vec;

            vec   = rectRight.localPosition;
            vec.x = -1000 - size.x / 2;
            rectRight.localPosition = vec;
            Vector2 v2 = new Vector2(2000, size.y);

            rectRight.sizeDelta = v2;
            rectleft.sizeDelta  = v2;

            vec   = rectleft.localPosition;
            vec.x = 1000 + size.x / 2;
            rectleft.localPosition = vec;

            if (pos.x > Baselayer.halfuiWidth)
            {
                createAvatar(true);
            }
            else
            {
                createAvatar(false);
            }
        }