Esempio n. 1
0
        private bool TryMove(LTInstanceNode start, LTInstanceNode end)
        {
            if (start == null && end != null)//初始化地图时候
            {
                if (RowObjContainer != null)
                {
                    RowObjContainer.transform.localPosition = new Vector3(-(end.x + end.y) * LTInstanceConfig.MAP_X, (end.y - end.x) * LTInstanceConfig.MAP_Y, 0);
                }
                else
                {
                    setRowObjContainerPos = true;
                }
                StopMove();
                return(false);
            }

            if (start == end)//无法移动的点
            {
                StopMove();
                return(false);
            }

            if (start != null && end != null)
            {
                MoveCoroutine = StartCoroutine(Move(start, end));
            }
            return(true);
        }
Esempio n. 2
0
 public virtual void Init(LTInstanceNode nodeData)
 {
     imgName               = GetImgName(nodeData.RoleData.Img);
     this.nodeData         = nodeData;
     RoleSprite.spriteName = imgName;
     PlayAni();
 }
Esempio n. 3
0
 public static void CurGridMap_OnFloorClicked(LTInstanceNode node, Transform tf)
 {
     if (LTGeneralInstanceHudController.Instance != null)
     {
         LTGeneralInstanceHudController.Instance.OnFloorClickFunc(node, tf);
     }
 }
Esempio n. 4
0
 public void MapDataUpdateFunc_EnqueueNode(LTInstanceNode node, bool isInit)
 {
     _CheckMapDataUpdate_Queue.Enqueue(node);
     _CheckMapDataUpdate_Dirty = true;
     if (isInit)
     {
         Update_CheckMapDataUpdate(true);
     }
 }
Esempio n. 5
0
 public bool IsNeighbourPos(LTInstanceNode node)
 {
     if ((Math.Abs(this.x - node.x) == 1 && this.y == node.y) ||
         Math.Abs(this.y - node.y) == 1 && this.x == node.x)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 6
0
        public override void SetMenuData(object param)
        {
            LTInstanceNode data = param as LTInstanceNode;

            if (data != null)
            {
                mCurNode = data;
            }
        }
Esempio n. 7
0
        public void CreateNodeFromCache(LTInstanceNode data)
        {
            if (data == null)
            {
                EB.Debug.LogError("CreateNodeFromCache===>data is null!");
                return;
            }

            GameObject         obj  = null;
            LTInstanceNodeTemp temp = null;

            if (IsSmallMap)
            {
                if (data.Type == LTInstanceNode.NodeType.WALL)
                {
                    obj = GameObject.Instantiate(Wall, mDMono.transform);
                }
                else if (data.Type == LTInstanceNode.NodeType.Floor)
                {
                    obj = GameObject.Instantiate(Floor, mDMono.transform);
                }
                temp = obj.GetMonoILRComponent <LTInstanceNodeTemp>();
            }
            else
            {
                if (data.Type == LTInstanceNode.NodeType.WALL)
                {
                    //GetOneWall(st_CacheWall, st_CacheWall_Comp, out obj, out temp);
                    obj = GameObject.Instantiate(Wall, mDMono.transform);
                    obj.CustomSetActive(true);
                    temp = obj.GetMonoILRComponent <LTInstanceNodeTemp>();
                }
                else if (data.Type == LTInstanceNode.NodeType.Floor)
                {
                    //GetOneFloor(st_CacheFloor, st_CacheFloor_Comp, out obj, out temp);
                    obj = GameObject.Instantiate(Floor, mDMono.transform);
                    obj.CustomSetActive(true);
                    temp = obj.GetMonoILRComponent <LTInstanceNodeTemp>();
                }
            }

            obj.CustomSetActive(true);
            if (IsSmallMap)
            {
                obj.transform.localPosition = new Vector3(data.x * LTInstanceConfig.SMALL_MAP_SCALE_X, data.x * LTInstanceConfig.SMALL_MAP_SCALE_Y, 0);
            }
            else
            {
                obj.transform.localPosition = new Vector3(data.x * LTInstanceConfig.MAP_X, data.x * LTInstanceConfig.MAP_Y, data.x * LTInstanceConfig.MAP_XZ);
            }
            obj.transform.localScale = Vector3.one;
            obj.name = data.x.ToString();
            //----
            temp.MapCtrl = MapCtrl;
            temp.SetData(data.x, data);
            itemObjDic[data.x] = temp;
        }
Esempio n. 8
0
        private void SetCurNode()
        {
            if (curNum == 0)
            {
                return;
            }
            int cur  = Mathf.Min(curNum - 1, moveActionList.Count - 1);
            var vec2 = moveActionList[cur];

            curNode = LTInstanceMapModel.Instance.GetNodeByPos((int)vec2.x, (int)vec2.y);
        }
Esempio n. 9
0
        public override void Init(LTInstanceNode nodeData)
        {
            base.Init(nodeData);
            skillId = nodeData.RoleData.CampaignData.SkillId;

            Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skillId);
            if (skillTpl != null)
            {
                skillSprite.spriteName = skillTpl.Icon;
            }
        }
Esempio n. 10
0
 public override void OnFloorClickFunc(LTInstanceNode NodeData, Transform Target)
 {
     if (NodeData.RoleData != null && NodeData.RoleData.CampaignData != null && NodeData.RoleData.CampaignData.Bonus.Count > 1)
     {
         Hashtable data = Johny.HashtablePool.Claim();
         data.Add("data", NodeData.RoleData.CampaignData.Bonus);
         data.Add("tip", string.Format(EB.Localizer.GetString("ID_MONOPOLY_TIP2")));
         data.Add("title", string.Format(EB.Localizer.GetString("ID_MONOPOLY_TITLE2")));
         InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
         GlobalMenuManager.Instance.Open("LTRewardShowUI", data);
     }
 }
Esempio n. 11
0
        //是否为相同点
        public bool IsSameNodePos(LTInstanceNode node)
        {
            if (node == null)
            {
                return(false);
            }

            if (this.x == node.x && this.y == node.y)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 12
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);
            Hashtable data = param as Hashtable;

            if (data != null)
            {
                mNodeData  = data["NodeData"] as LTInstanceNode;
                mCallback  = data["Callback"] as System.Action <bool>;
                mIsHire    = (bool)data["IsHire"];
                mChapterBg = (string)data["ChapterBg"];
            }
        }
Esempio n. 13
0
 public override void Init(LTInstanceNode nodeData)
 {
     base.Init(nodeData);
     Effect.gameObject.CustomSetActive(false);
     if (mDMono.gameObject.activeInHierarchy)
     {
         Transform go = mDMono.transform.parent.parent;
         if (go != null)
         {
             GuideNodeManager.GateString = GetParentPath(go.name, go.parent);
         }
     }
 }
Esempio n. 14
0
        private void CreateRow(LTInstanceNode node)
        {
            GameObject row = GameObject.Instantiate(RowObj);

            row.CustomSetActive(true);
            row.transform.SetParent(RowObjContainer.transform);
            row.transform.localPosition = new Vector3(node.y * LTInstanceConfig.SMALL_MAP_SCALE_X, -node.y * LTInstanceConfig.SMALL_MAP_SCALE_Y);
            row.transform.localScale    = Vector3.one;
            row.name = node.y.ToString();
            LTInstanceRowCtrl ctrl = row.GetMonoILRComponent <LTInstanceRowCtrl>();

            ctrl.CreateNodeFromCache(node);
            rowCtrlDic.Add(node.y, ctrl);
        }
Esempio n. 15
0
        private void HideFloorRole(Vector2 vec2)
        {
            LTInstanceNode node = LTInstanceMapModel.Instance.GetNodeByPos((int)vec2.x, (int)vec2.y);

            if (node != null)
            {
                node.RoleData = new LTInstanceNodeRoleData();
                Instance.LTInstanceFloorTemp floorTmp = MapCtrl.GetNodeObjByPos(vec2) as Instance.LTInstanceFloorTemp;
                if (floorTmp != null)
                {
                    floorTmp.ClearRoleItem();
                }
            }
        }
Esempio n. 16
0
 public void OnDestinationMove(LTInstanceNode cur, LTInstanceNode target, int num)
 {
     bossRewardStop = false;
     moveActionList = LTInstanceMapModel.Instance.GetRoad(cur, target, false, ref bossRewardStop);
     if (moveActionList == null)
     {
         return;
     }
     if (num < moveActionList.Count)
     {
         moveActionList.RemoveRange(num, moveActionList.Count - num);
     }
     moveType = MoveParam.Fabricate;
     AutoMoveMap();
 }
Esempio n. 17
0
        private void RequestChallengeMoveChar(LTInstanceNode targetNode, MoveParam type)
        {
            if (targetNode == null || LTInstanceMapModel.Instance.CurNode == null)
            {
                return;
            }

            int dir = (int)LTInstanceMapModel.Instance.CurNode.GetDirByPos(targetNode.x, targetNode.y);

            if (dir <= 0)
            {
                if (moveActionList != null && moveActionList.Count > 0)
                {
                    ClearMoveActionList();
                }
                return;
            }

            bool isLoayout = !string.IsNullOrEmpty(targetNode.Layout);

            if (type == MoveParam.Fabricate)
            {
                LTInstanceMapModel.Instance.SimulateFunc(dir);
                return;
            }

            //直接或Boss区域特殊逻辑或时,直接调用协议,不等待
            if (type == MoveParam.Direct || LTInstanceMapModel.Instance.IsBossArea())
            {
                RequestMoveCharWithCallback(dir, isLoayout);
                return;
            }

            //前端模拟
            if (type == MoveParam.Simulate && (HasNext() || !HasNext() && (targetNode.RoleData.Id == 0 || LTInstanceConfig.EmptyRoleList.Contains(targetNode.RoleData.Img))))
            {
                LTInstanceMapModel.Instance.SimulateFunc(dir);
                return;
            }

            //同步数据回调后才能调用
            InstanceWaitUpdataMap(delegate
            {
                RequestMoveCharWithCallback(dir, isLoayout);
            }, false);
        }
Esempio n. 18
0
        private void OnGetToMonster(LTInstanceNode NodeData, Transform Target, bool isBoss)
        {
            if (isBoss)
            {
                int dir = (int)LTInstanceMapModel.Instance.CurNode.GetProbablyDirByPos(NodeData.x, NodeData.y);
                if (dir <= 0)
                {
                    return;
                }

                LTInstanceMapModel.Instance.RequestMoveChar(dir);
            }
            else
            {
                MapCtrl.OnFloorClick(NodeData, Target);
            }
        }
Esempio n. 19
0
 public override void SetMenuData(object param)
 {
     nodeData = param as LTInstanceNode;
     if (nodeData == null)
     {
         Hashtable hash = param as Hashtable;
         nodeData = hash["data"] as LTInstanceNode;
         string title = hash["title"] as string;
         string tip   = hash["tip"] as string;
         TitleLabel.text = title;
         TipLabel.text   = tip;
     }
     else
     {
         TitleLabel.text = EB.Localizer.GetString("ID_codefont_in_ChapterDialogController_2241");
         TipLabel.text   = EB.Localizer.GetString("ID_uifont_in_LTMainInstancePasswordBoxView_Desc_0");
     }
 }
Esempio n. 20
0
        public void ReInit()
        {
            if (SmallMapCtrl != null)
            {
                SmallMapCtrl.ReInit();
            }
            foreach (var pair in rowCtrlDic)
            {
                GameObject.Destroy(pair.Value.mDMono.gameObject);
            }
            rowCtrlDic.Clear();
            hasSetStartPos = false;
            PlayerObj.transform.localPosition = Vector2.zero;
            curNode = lastNode = null;
            Instance.LTInstanceOptimizeManager.Instance.HideSelectObj();

            EdgeObj.CustomSetActive(false);
        }
Esempio n. 21
0
        private void CreateRowFromCache(LTInstanceNode node)
        {
            GameObject        row  = null;
            LTInstanceRowCtrl ctrl = null;

            row  = GameObject.Instantiate(RowObj);
            ctrl = row.GetMonoILRComponent <LTInstanceRowCtrl>();

            row.CustomSetActive(true);
            row.transform.SetParent(RowObjContainer.transform);
            row.transform.localPosition = new Vector3(node.y * LTInstanceConfig.MAP_X, -node.y * LTInstanceConfig.MAP_Y, -node.y * LTInstanceConfig.MAP_YZ);
            row.transform.localScale    = Vector3.one;
            row.name = node.y.ToString();
            mRows.Add(row);
            //------
            ctrl.MapCtrl = this;
            ctrl.Num     = node.y;
            ctrl.CreateNodeFromCache(node);
            rowCtrlDic.Add(node.y, ctrl);
        }
Esempio n. 22
0
 public override void Init(LTInstanceNode nodeData)
 {
     base.Init(nodeData);
     if (LTInstanceConfig.RoleEffectNameDic.ContainsKey(imgName))
     {
         ParticleSystem par = LTInstanceEffect.Instance.GetParticleByEffectName(LTInstanceConfig.RoleEffectNameDic[imgName]);
         if (par != null)
         {
             Effect.fx = par;
             Effect.gameObject.CustomSetActive(true);
         }
     }
     if (mDMono.gameObject.activeInHierarchy)
     {
         Transform go = mDMono.transform.parent.parent;
         if (go != null)
         {
             GuideNodeManager.GateString = GetParentPath(go.name, go.parent);
         }
     }
 }
Esempio n. 23
0
        private void RealEndHandler(LTInstanceNode targetNode, bool isPath = true)
        {
            if (targetNode == null)
            {
                return;
            }

            Instance.LTInstanceFloorTemp floorTmp = GetNodeObjByPos(new Vector2(targetNode.x, targetNode.y)) as Instance.LTInstanceFloorTemp;
            if (floorTmp != null && floorTmp.OnCheckGuideNotice())
            {
                return;
            }

            if (OnRealEnd != null)
            {
                System.Action <bool> tmp = OnRealEnd;
                OnRealEnd = null;
                tmp(isPath);
                return;
            }

            if (mRealEndNode == null)
            {
                return;
            }
            if (moveActionList == null || moveActionList.Count > 0)
            {
                return;
            }
            if (targetNode.IsSameNodePos(mRealEndNode))
            {
                return;
            }
            if (mRealEndNode.RoleData != null && mRealEndNode.RoleData.CampaignData != null && !string.IsNullOrEmpty(mRealEndNode.RoleData.CampaignData.Password))
            {
                return;
            }

            RequestChallengeMoveChar(mRealEndNode, MoveParam.Direct);
        }
Esempio n. 24
0
 public override void UpdateData(LTInstanceNode data)
 {
     base.UpdateData(data);
     SetTexture();
 }
Esempio n. 25
0
        public override void OnFloorClickFunc(LTInstanceNode NodeData, Transform Target)
        {
            if (NodeData == null)
            {
                return;
            }
            MapCtrl.OnRealEnd = null;
            //设置OnRealEnd到达格子后需要做的事情
            if (!string.IsNullOrEmpty(NodeData.Layout))//怪物
            {
                bool isBoss = false;
                if (NodeData.RoleData.Order == "Boss" || NodeData.RoleData.Id == -1)
                {
                    isBoss = true;
                }

                MapCtrl.OnRealEnd = new System.Action <bool>(delegate(bool isPath)
                {
                    int dir = (int)LTInstanceMapModel.Instance.CurNode.GetDirByPos(NodeData.x, NodeData.y);
                    if (dir <= 0 && !isBoss && !isPath)
                    {
                        return;
                    }

                    if (IsChallengeQuick)//快速战斗
                    {
                        Instance.LTInstanceFloorTemp tmp = MapCtrl.GetNodeObjByPos(new Vector2(NodeData.x, NodeData.y)) as Instance.LTInstanceFloorTemp;
                        if (tmp != null)
                        {
                            FusionAudio.PostEvent("UI/New/Fight", true);
                            InputBlockerManager.Instance.Block(InputBlockReason.UI_SERVER_REQUEST, 2f);
                            tmp.ShowQuickBattleFX();
                            MapCtrl.OnFloorClick(NodeData, Target);
                        }
                        return;
                    }

                    if (!IsChallengeQuick && IsChallengeSkip)//跳过布阵
                    {
                        FusionAudio.PostEvent("UI/New/Fight", true);
                        InputBlockerManager.Instance.Block(InputBlockReason.UI_SERVER_REQUEST, 2f);
                        OnGetToMonster(NodeData, Target, isBoss);
                        return;
                    }

                    if (!IsChallengeQuick && !IsChallengeSkip)//正常战斗
                    {
                        BattleReadyHudController.Open(eBattleType.ChallengeCampaign, delegate()
                        {
                            OnGetToMonster(NodeData, Target, isBoss);
                        }, NodeData.RoleData.CampaignData.Layout);
                        return;
                    }
                });
                MapCtrl.OnFloorClick(NodeData, Target, isBoss);
                return;
            }
            else if (NodeData.RoleData.Img == "Copy_Icon_Gonggaopai")//留言板
            {
                MapCtrl.OnRealEnd = new System.Action <bool>(delegate(bool isPath)
                {
                    GlobalMenuManager.Instance.Open("LTInstanceMessageView", NodeData.RoleData.Id);
                });
                MapCtrl.OnFloorClick(NodeData, Target);
                return;
            }

            MapCtrl.OnFloorClick(NodeData, Target);
        }
Esempio n. 26
0
 public void SetRight(LTInstanceNode node)
 {
     RightNode = node;
 }
Esempio n. 27
0
 public void SetLeft(LTInstanceNode node)
 {
     LeftNode = node;
 }
Esempio n. 28
0
 public void SetDown(LTInstanceNode node)
 {
     DownNode = node;
 }
Esempio n. 29
0
 public void SetUp(LTInstanceNode node)
 {
     UpNode = node;
 }
Esempio n. 30
0
        public override void OnFloorClickFunc(LTInstanceNode NodeData, Transform Target)
        {
            if (NodeData == null) return;
            MapCtrl.OnRealEnd = null;
            //设置OnRealEnd到达格子后需要做的事情
            if (NodeData.RoleData.CampaignData.CampaignId > 0)//主线关卡
            {
                LTGuideTips.MainInstanceCampaignId = NodeData.RoleData.CampaignData.CampaignId;

                MapCtrl.OnRealEnd = new System.Action<bool>(delegate (bool isPath)
                {
                    MapCtrl.InstanceWaitUpdataMap(delegate
                    {
                        if (GuideNodeManager.IsGuide && !theFirstCampaignPass)//新手引导特殊处理步骤
                        {
                            //是否已通关了第一关卡    
                            FusionAudio.PostEvent("UI/New/Fight", true);
                            InputBlockerManager.Instance.Block(InputBlockReason.UI_SERVER_REQUEST, 2f);
                            MapCtrl.OnFloorClick(NodeData, Target);
                            LTInstanceMapModel.Instance.RequestMainFightCampaign(NodeData.RoleData.CampaignData.CampaignId);
                            return;
                        }

                        if (LTInstanceMapModel.Instance.WaitForDialoging ||DialoguePlayUtil.Instance.State) return;//剧情播放情况,不要再执行下面

                        if (IsMainQuick)
                        {
                            bool isCanQuick = NodeData.RoleData.CampaignData.Star == 0;
                            bool isNotBoss = !Data.SceneTemplateManager.Instance.IsCampaignBoss(NodeData.RoleData.CampaignData.CampaignId.ToString());
                            if (isCanQuick && isNotBoss)
                            {
                                Instance.LTInstanceFloorTemp tmp = MapCtrl.GetNodeObjByPos(new Vector2(NodeData.x, NodeData.y)) as Instance.LTInstanceFloorTemp;
                                if (tmp != null)
                                {
                                    FusionAudio.PostEvent("UI/New/Fight", true);
                                    InputBlockerManager.Instance.Block(InputBlockReason.UI_SERVER_REQUEST, 2f);
                                    tmp.ShowQuickBattleFX();
                                    MapCtrl.OnFloorClick(NodeData, Target);
                                    LTInstanceMapModel.Instance.RequestMainFightCampaign(NodeData.RoleData.CampaignData.CampaignId, 0, true);
                                }
                                return;
                            }
                        }

                        Hashtable data = Johny.HashtablePool.Claim();
                        data.Add("id", NodeData.RoleData.CampaignData.CampaignId);
                        data.Add("callback", new System.Action(delegate
                        {
                            MapCtrl.OnFloorClick(NodeData, Target);
                        }));
                        GlobalMenuManager.Instance.Open("LTMainInstanceCampaignView", data);
                    });
                });
                MapCtrl.OnFloorClick(NodeData, Target);
                return;
            }
            else if (!string.IsNullOrEmpty(NodeData.RoleData.CampaignData.Password))//箱子需要密码才能打开,此处密码由前端检查
            {
                MapCtrl.OnRealEnd = new System.Action<bool>(delegate (bool isPath)
                {
                    GlobalMenuManager.Instance.Open("LTMainInstancePasswordBoxView", NodeData);
                });
                MapCtrl.OnFloorClick(NodeData, Target);
                return;
            }
            else if (!string.IsNullOrEmpty(NodeData.RoleData.Model) && (NodeData.RoleData.Order == "Hero"))//奖励英雄
            {
                MapCtrl.OnRealEnd = new System.Action<bool>(delegate (bool isPath)
                {
                    //SetBlurTexState(false);
                    Hashtable data = Johny.HashtablePool.Claim();
                    data.Add("NodeData", NodeData);
                    data.Add("IsHire", false);
                    data.Add("ChapterBg", mChapterTpl.ChapterBg);
                    data.Add("Callback", new System.Action<bool>(delegate (bool isSucc)
                    {
                        //SetBlurTexState(true);
                        if (isSucc)
                        {
                            MapCtrl.OnFloorClick(NodeData, Target);
                            var charTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfoByModel(NodeData.RoleData.Model);
                            if (charTpl != null)
                            {
                                LTShowItemData itemData = new LTShowItemData((charTpl.id + 1).ToString(), 1, "hero", false);
                                GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData);
                            }
                        }
                    }));
                    GlobalMenuManager.Instance.Open("LTMainInstanceGetHeroView", data);
                });
                MapCtrl.OnFloorClick(NodeData, Target);
                return;
            }
            else if (!string.IsNullOrEmpty(NodeData.RoleData.Model) && (NodeData.RoleData.Order == "Hire"))//雇佣兵
            {
                MapCtrl.OnRealEnd = new System.Action<bool>(delegate (bool isPath)
                {
                    Hashtable data = Johny.HashtablePool.Claim();
                    data.Add("NodeData", NodeData);
                    data.Add("IsHire", true);
                    data.Add("ChapterBg", mChapterTpl.ChapterBg);
                    data.Add("Callback", new System.Action<bool>(delegate (bool isSucc)
                    {
                        if (isSucc)
                        {
                            MapCtrl.OnFloorClick(NodeData, Target);
                            var charTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfoByModel(NodeData.RoleData.Model);
                            if (charTpl != null)
                            {
                                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_CHALLENGE_INSTANCE_HIRE_0"), charTpl.name));
                            }

                            Instance.LTInstanceFloorTemp tmp = MapCtrl.GetNodeObjByPos(new Vector2(NodeData.x, NodeData.y)) as Instance.LTInstanceFloorTemp;
                            if (tmp != null)
                            {
                                tmp.HideNotice();
                            }
                        }
                    }));
                    GlobalMenuManager.Instance.Open("LTMainInstanceGetHeroView", data);
                });
                MapCtrl.OnFloorClick(NodeData, Target);
                return;
            }
            else if (NodeData.RoleData.Img == "Copy_Icon_Gonggaopai")
            {
                MapCtrl.OnRealEnd = new System.Action<bool>(delegate (bool isPath)
                {
                    GlobalMenuManager.Instance.Open("LTInstanceMessageView", NodeData.RoleData.Id);
                });
                MapCtrl.OnFloorClick(NodeData, Target);
                return;
            }

            MapCtrl.OnFloorClick(NodeData, Target);
        }