Пример #1
0
 public void initData()
 {
     this.m_cGateMgr   = new NrGateManager();
     this.m_cMapLinker = new NrMapLinker();
     this.m_cMapLinker.SetGateManager(ref this.m_cGateMgr);
     this.m_cMapAstar = new MapLinkAStar();
     this.m_cMapAstar.SetMapData(ref this.m_cMapLinker);
     this.m_cGxRoadPointMgr             = NrTSingleton <GxRoadPointManager> .Instance;
     this.m_cGxRoadPointAstar           = new GxRoadPointAstar();
     this.m_cGxRoadPointAstar.m_pkRPSys = this.m_cGxRoadPointMgr;
     this.m_bAutoMove     = false;
     this.m_pkUserObj     = null;
     this.m_pkCharMapInfo = null;
 }
Пример #2
0
    private bool ReadyCharInfo()
    {
        if (this.m_pkUserObj == null)
        {
            GameObject myCharObject = NrTSingleton <NkCharManager> .Instance.GetMyCharObject();

            if (myCharObject == null)
            {
                this.m_Debugstring.Add("ReadyCharInfo: NOT FOUND USER ");
                return(false);
            }
            this.m_MainUser = NrTSingleton <NkCharManager> .Instance.GetChar(1);

            this.m_pkUserObj     = myCharObject;
            this.m_pkCharMapInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_kCharMapInfo;
        }
        return(true);
    }
Пример #3
0
    public override void SetComponent()
    {
        this.m_lbFPS        = (base.GetControl("Label_Label4") as Label);
        this.m_lbSoldierPos = (base.GetControl("Label_Label4_C") as Label);
        this.m_lbDUN        = (base.GetControl("Label_Label2") as Label);
        this.m_UserObject   = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetMyCharObject();

        NrCharMapInfo kCharMapInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_kCharMapInfo;

        this.m_lbDUN.Text = string.Concat(new object[]
        {
            "MAP INDEX: ",
            kCharMapInfo.m_nMapIndex,
            " MAP UNIQUE:",
            kCharMapInfo.MapUnique,
            " INDUN UNIQUE:",
            NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_nIndunUnique,
            "\r\n",
            Screen.width.ToString(),
            " ",
            Screen.height.ToString()
        });
        this.m_lbTotal       = (base.GetControl("Label_Total") as Label);
        this.m_lbScene       = (base.GetControl("Label_Scene") as Label);
        this.m_lbPing        = (base.GetControl("Label_ping") as Label);
        this.m_lbTotalTime   = (base.GetControl("Label_TotalTime") as Label);
        this.m_lbRealTime    = (base.GetControl("Label_RealTime") as Label);
        this.m_lbMonster     = (base.GetControl("Label_Mob") as Label);
        this.m_lbNPC         = (base.GetControl("Label_NPC") as Label);
        this.m_lbUser        = (base.GetControl("Label_User") as Label);
        this.m_lbMax         = (base.GetControl("Label_Max") as Label);
        this.m_lbCurrent     = (base.GetControl("Label_Current") as Label);
        this.m_lbTotal_Quest = (base.GetControl("Label_Total_Quest") as Label);
        this.m_lbUseNetTime  = (base.GetControl("Label_UseNetTime") as Label);
        this.m_lbUseNetSize  = (base.GetControl("Label_UseNetSize") as Label);
    }
Пример #4
0
 public StageWorld()
 {
     this.m_kCharMapInfo = new NrCharMapInfo();
 }
Пример #5
0
    private void _BeforeMapLoad()
    {
        NpcCache.Enabled               = true;
        this.m_kCharMapInfo            = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_kCharMapInfo;
        StageWorld.m_bWorldStable      = false;
        this.m_bAfterWorldLoadComplete = false;
        NrTSingleton <NkClientLogic> .Instance.SetNPCTalkState(false);

        NrTSingleton <NkQuestManager> .Instance.RewardShow = false;
        if (Scene.CurScene != Scene.Type.EMPTY)
        {
            if (Scene.PreScene == Scene.Type.WORLD && Scene.CurScene == Scene.Type.BATTLE)
            {
                if (TsPlatform.IsLowSystemMemory || TsPlatform.IsEditor)
                {
                    StageWorld.m_bReloadMap = true;
                }
                else
                {
                    StageWorld.m_bReloadMap = false;
                }
            }
            else if (Scene.PreScene == Scene.Type.BATTLE && Scene.CurScene == Scene.Type.WORLD)
            {
                if (TsPlatform.IsLowSystemMemory || TsPlatform.IsEditor)
                {
                    StageWorld.m_bReloadMap = true;
                }
                else
                {
                    StageWorld.m_bReloadMap = false;
                }
            }
            else if (Scene.PreScene == Scene.Type.SOLDIER_BATCH && Scene.CurScene == Scene.Type.WORLD)
            {
                if (TsPlatform.IsLowSystemMemory || TsPlatform.IsEditor)
                {
                    StageWorld.m_bReloadMap = true;
                }
                else
                {
                    StageWorld.m_bReloadMap = false;
                }
            }
            else
            {
                StageWorld.m_bReloadMap = true;
            }
        }
        else
        {
            StageWorld.m_bReloadMap = true;
        }
        this.DeleteWorldMap();
        this.m_bLoadMap = false;
        NrTSingleton <NrTerrain> .Instance.InitTerrainInfo();

        this.m_kCharMapInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_kCharMapInfo;
        int nMapIndex = this.m_kCharMapInfo.m_nMapIndex;

        if (NrTSingleton <MapManager> .Instance.LoadCurrentMapResource(nMapIndex, this) || StageWorld.m_bReloadMap)
        {
            this.Init_Map(this);
        }
    }
Пример #6
0
 public void ClearUserData()
 {
     this.m_MainUser      = null;
     this.m_pkUserObj     = null;
     this.m_pkCharMapInfo = null;
 }
Пример #7
0
    public void _SetComponetBasic()
    {
        UIBaseFileManager instance = NrTSingleton <UIBaseFileManager> .Instance;

        instance.CreateCloseButton(ref this.closeButton, UIDataManager.closeButtonName, base.Scale);
        this.m_lbWorldMap_Title       = (base.GetControl("LB_Title") as Label);
        this.m_dtWorldMap_Map         = (base.GetControl("DT_map") as DrawTexture);
        this.m_dtLocalMap_Map         = (base.GetControl("DT_AreaBG") as DrawTexture);
        this.m_dtLocalMap_Day         = (base.GetControl("DT_Day") as DrawTexture);
        this.m_dtLocalMap_Day.Visible = false;
        this.m_dtLocalMap_Night       = (base.GetControl("DT_Night") as DrawTexture);
        this.m_dtLocalMap_Night.SetLocation(this.m_dtLocalMap_Night.GetLocationX(), this.m_dtLocalMap_Night.GetLocationY(), -0.004f);
        this.m_dtLocalMap_Night.Visible     = false;
        this.m_btLocalMap_ReWorld           = (base.GetControl("BT_WorldMap") as Button);
        this.m_btLocalMap_ReWorld.EffectAni = false;
        Button expr_F2 = this.m_btLocalMap_ReWorld;

        expr_F2.Click           = (EZValueChangedDelegate)Delegate.Combine(expr_F2.Click, new EZValueChangedDelegate(this.OnClickLocalMapReWorld));
        this.m_btLocalMap_Night = (base.GetControl("BT_Night") as Button);
        Button expr_12F = this.m_btLocalMap_Night;

        expr_12F.Click        = (EZValueChangedDelegate)Delegate.Combine(expr_12F.Click, new EZValueChangedDelegate(this.OnClickLocalMapNight));
        this.m_btLocalMap_Day = (base.GetControl("BT_Day") as Button);
        Button expr_16C = this.m_btLocalMap_Day;

        expr_16C.Click = (EZValueChangedDelegate)Delegate.Combine(expr_16C.Click, new EZValueChangedDelegate(this.OnClickLocalMapDay));
        this.m_btLocalMap_NpcAutoMove = (base.GetControl("BT_NpcAutoMove") as Button);
        Button expr_1A9 = this.m_btLocalMap_NpcAutoMove;

        expr_1A9.Click = (EZValueChangedDelegate)Delegate.Combine(expr_1A9.Click, new EZValueChangedDelegate(this.OnClickLocalMapNpcAutoMove));
        this.m_btLocalMap_NpcAutoMove.EffectAni = false;
        this.m_btUser_User = (base.GetControl("BT_UserBG") as Button);
        this.m_btUser_User.controlIsEnabled = false;
        this.m_dtUser_Icon = (base.GetControl("DT_UserImg") as DrawTexture);
        NrMyCharInfo myCharInfo = NrTSingleton <NkCharManager> .Instance.GetMyCharInfo();

        Texture2D texture2D = null;

        if (myCharInfo != null)
        {
            int num      = myCharInfo.GetFaceCharKind();
            int solgrade = (int)myCharInfo.GetFaceSolGrade();
            if (num == 0)
            {
                NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

                if (nrCharUser != null)
                {
                    NkSoldierInfo soldierInfo = nrCharUser.GetPersonInfoUser().GetSoldierInfo(0);
                    if (soldierInfo != null && soldierInfo.IsValid())
                    {
                        num      = soldierInfo.GetCharKind();
                        solgrade = (int)soldierInfo.GetGrade();
                    }
                }
            }
            if (myCharInfo.UserPortrait)
            {
                texture2D = myCharInfo.UserPortraitTexture;
            }
            if (texture2D != null)
            {
                this.m_dtUser_Icon.SetTexture(texture2D);
            }
            else
            {
                string costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(myCharInfo.GetFaceCostumeUnique());

                this.m_dtUser_Icon.SetTexture(eCharImageType.SMALL, num, solgrade, costumePortraitPath);
            }
        }
        this.m_btUser_User.Visible = false;
        this.m_dtUser_Icon.Visible = false;
        this.m_WorldMapInfo        = NrTSingleton <NrBaseTableManager> .Instance.GetWorldMapInfo("1");

        if (this.m_WorldMapInfo == null)
        {
            return;
        }
        this.m_MaxLocalMapCount = NrTSingleton <NrBaseTableManager> .Instance.GetLocalMapCount();

        this.m_btWorldMap_AreaIcon = new UIButton[this.m_MaxLocalMapCount];
        this.m_lbWorldMap_AreaName = new Label[this.m_MaxLocalMapCount];
        this.m_pkCharMapInfo       = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_kCharMapInfo;
        this.m_selectLocalMap      = NrTSingleton <NrBaseTableManager> .Instance.GetLocalMapInfoFromMapIndex(this.m_pkCharMapInfo.m_nMapIndex);

        if (this.m_selectLocalMap == null)
        {
            this.Close();
            return;
        }
        string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(this.m_selectLocalMap.LOCALMAP_NAME_TEXT_INDEX);

        this.m_lbWorldMap_Title.SetText(textFromInterface);
        this.m_dtLocalMap_Map.SetTextureFromBundle(this.m_selectLocalMap.GetBundlePath());
        MAP_INFO mapInfo = NrTSingleton <NrBaseTableManager> .Instance.GetMapInfo(this.m_pkCharMapInfo.m_nMapIndex.ToString());

        if (mapInfo != null && mapInfo.MAP_NIGHTMODE == 1)
        {
            this.m_bNowNightMode = true;
        }
        string name  = string.Empty;
        string name2 = string.Empty;

        this.m_btLocalMap_AreaIcon = new UIButton[20];
        this.m_lbLocalMap_AreaName = new Label[20];
        for (int i = 0; i < 20; i++)
        {
            name  = "BT_LocalMapAreaIcon" + i.ToString();
            name2 = "LB_LocalMapAreaName" + i.ToString();
            this.m_btLocalMap_AreaIcon[i] = UICreateControl.Button(name, "Main_B_Map", 64f, 64f);
            this.m_lbLocalMap_AreaName[i] = UICreateControl.Label(name2, null, false, 280f, 28f, SpriteText.Font_Effect.Black_Shadow_Small, SpriteText.Anchor_Pos.Middle_Center, SpriteText.Alignment_Type.Left, Color.white);
            if (null != this.m_btLocalMap_AreaIcon[i])
            {
                this.m_btLocalMap_AreaIcon[i].Data = 0;
                this.m_btLocalMap_AreaIcon[i].SetSize(64f, 64f);
                this.m_btLocalMap_AreaIcon[i].Start();
                this.m_btLocalMap_AreaIcon[i].UseDefaultSound = false;
                this.m_lbLocalMap_AreaName[i].Visible         = false;
                base.InteractivePanel.MakeChild(this.m_btLocalMap_AreaIcon[i].gameObject);
                base.InteractivePanel.MakeChild(this.m_lbLocalMap_AreaName[i].gameObject);
            }
        }
        for (int j = 0; j < 20; j++)
        {
            this.m_pTreasure[j] = new TreasureData();
            this.m_pTreasure[j].Init(j);
            this.m_pTreasure[j].TreasureShow(false);
            if (this.m_pTreasure[j].GetTexture())
            {
                base.InteractivePanel.MakeChild(this.m_pTreasure[j].GetTexture().gameObject);
            }
            if (this.m_pTreasure[j].GetDrawTexture())
            {
                base.InteractivePanel.MakeChild(this.m_pTreasure[j].GetDrawTexture().gameObject);
            }
        }
        this.SetLocalMapTitle();
        this.SetLocalMapMapIcon();
        for (int k = 0; k < this.m_MaxLocalMapCount; k++)
        {
            int           num2         = k + 1;
            LOCALMAP_INFO localMapInfo = NrTSingleton <NrBaseTableManager> .Instance.GetLocalMapInfo(num2.ToString());

            if (localMapInfo != null)
            {
                if (localMapInfo.LOCALMAP_IDX == num2)
                {
                    if (localMapInfo != null)
                    {
                        name  = "BT_WorldMapAreaIcon" + k.ToString();
                        name2 = "LB_WorldMapAreaName" + k.ToString();
                        this.m_btWorldMap_AreaIcon[k]           = UICreateControl.Button(name, localMapInfo.LOCALMAP_ICON, 64f, 64f);
                        this.m_btWorldMap_AreaIcon[k].EffectAni = false;
                        string textFromInterface2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(localMapInfo.LOCALMAP_NAME_TEXT_INDEX);

                        this.m_lbWorldMap_AreaName[k] = UICreateControl.Label(name2, NrTSingleton <CTextParser> .Instance.GetTextColor("1002") + textFromInterface2, false, 280f, 28f, SpriteText.Font_Effect.Black_Shadow_Small, SpriteText.Anchor_Pos.Middle_Center, SpriteText.Alignment_Type.Left, Color.white);
                        if (null != this.m_btWorldMap_AreaIcon[k])
                        {
                            this.m_btWorldMap_AreaIcon[k].AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickWorldMapToLocalArea));
                            this.m_btWorldMap_AreaIcon[k].SetLocation(localMapInfo.LOCALMAP_X + 20f, localMapInfo.LOCALMAP_Y + 64f);
                            this.m_btWorldMap_AreaIcon[k].Data = localMapInfo.LOCALMAP_IDX;
                            this.m_lbWorldMap_AreaName[k].SetLocation(localMapInfo.LOCALMAP_X + 20f + -107f, localMapInfo.LOCALMAP_Y + 64f + 84f);
                            base.InteractivePanel.MakeChild(this.m_btWorldMap_AreaIcon[k].gameObject);
                            base.InteractivePanel.MakeChild(this.m_lbWorldMap_AreaName[k].gameObject);
                        }
                        this.m_btWorldMap_AreaIcon[k].Start();
                        if (!NrTSingleton <ContentsLimitManager> .Instance.IsWorldMapMove(num2))
                        {
                            this.m_btWorldMap_AreaIcon[k].Hide(true);
                            this.m_lbWorldMap_AreaName[k].Hide(true);
                        }
                    }
                }
            }
        }
        base.SetScreenCenter();
        this.ShowLocalMap(true);
        this.SetUserIcon();
    }