コード例 #1
0
        public override void DoUpdate()
        {
            if (PathUtil.NPC_ID != -1)
            {
                if (NpcLogic.GetInstance().CheckNpcNearby(PathUtil.NPC_ID))
                {
                    if (PathUtil.bAutoAttack)
                    {
                        SceneLogic.GetInstance().MainHero.property.CmdAutoAttack = true;
                    }
                    else
                    {
                        EventDispatcher.GameWorld.Dispath(ControllerCommand.OPEN_NPC_PANEL_BYID, PathUtil.NPC_ID);
                    }

                    PathUtil.bAutoAttack = false;
                    PathUtil.NPC_ID      = -1;
                }
            }

            ViewManager.GetInstance().AutoCloseNpcPanel();

            CollectObjComponent[] collectObjs = SceneLogic.GetInstance().GetAllCollectObj();

            foreach (CollectObjComponent coc in collectObjs)
            {
                if (CollectObjLogic.GetInstance().CheckNeedCollectID(coc.Owner.collectInfo.nID) && coc.CheckNearBy(coc.Owner.collectInfo.nCanCollectDistance))
                {
                    EventDispatcher.GameWorld.Dispath(ControllerCommand.OPEN_COLLECT_PANEL, coc.Owner.collectInfo.nID, coc.Owner.property.Id);
                    break;
                }
            }
        }
コード例 #2
0
ファイル: PathUtil.cs プロジェクト: moto2002/DinaGameClient
        public static void CarryToNPC(int npcID)
        {
            KNpcPos npcPos = NpcLogic.GetInstance().GetNpcPosByID(npcID);

            if (npcPos != null)
            {
                Carry(npcPos.MapID, new Vector3(npcPos.nPathX, npcPos.nPathY, npcPos.nPathZ));
            }
        }
コード例 #3
0
        private object UpdateMission(params object[] objs)
        {
            Dictionary <int, MissionInfo> curMission    = MissionLogic.GetInstance().GetCurrentMissionList();
            Dictionary <int, MissionInfo> canGetMission = MissionLogic.GetInstance().GetCanAcceptList();

            CollectObjLogic.GetInstance().ClearNeedCollectObjList();

            foreach (MissionInfo info in curMission.Values)
            {
                if (info.type == (int)MissionInfo.MissionType.MainMission)
                {
                    MissionName.text = info.questName;
                    MissionDes.text  = info.desc;
                    MissionCon.transform.localPosition   = MissionDes.transform.localPosition + new Vector3(0, -MissionDes.printedSize.y - 10, 0);
                    FeixieButton.transform.localPosition = new Vector3(FeixieButton.transform.localPosition.x, MissionCon.transform.localPosition.y - 6, 0);
                    if (info.curStatus == MissionInfo.MisssionStatus.BeenAccepted)
                    {
                        MissionCon.text = info.condition + " <FF0000>(未完成)<->";
                    }
                    else if (info.curStatus == MissionInfo.MisssionStatus.Finish)
                    {
                        KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(info.submitNpcID);
                        // 要加个" " 不然颜色变化会错乱
                        MissionCon.text = " " + "<a:" + info.submitNpcID + ">" + "去找" + npcInfo.Name + "</a>" + " <ffa200>(已完成)<->";
                    }
                    mainInfo = info;
                }
            }

            foreach (MissionInfo info in canGetMission.Values)
            {
                if (info.type == (int)MissionInfo.MissionType.MainMission)
                {
                    MissionName.text = info.questName;
                    MissionDes.text  = info.desc;
                    MissionCon.transform.localPosition   = MissionDes.transform.localPosition + new Vector3(0, -MissionDes.printedSize.y - 10, 0);
                    FeixieButton.transform.localPosition = new Vector3(FeixieButton.transform.localPosition.x, MissionCon.transform.localPosition.y - 6, 0);
                    KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(info.npcID);
                    MissionCon.text = "<a:" + info.npcID + ">" + "去找" + npcInfo.Name + "</a>";
                    mainInfo        = info;
                }
            }

            if (mainInfo != null)
            {
                if (mainInfo.curStatus == MissionInfo.MisssionStatus.BeenAccepted && mainInfo.subType == (int)MissionInfo.MissionSubType.Collect)
                {
                    int targetID;
                    if (TryGetIntIDFormString(mainInfo.condition, out targetID))
                    {
                        CollectObjLogic.GetInstance().AddNeedCollectObjID(targetID, mainInfo.id);
                    }
                }
            }

            return(null);
        }
コード例 #4
0
 public void AutoCloseNpcPanel()
 {
     if (npcView != null && npcView.isOpen())
     {
         if (!NpcLogic.GetInstance().CheckNpcNearby(npcView.PannelVO.npcID, 5))
         {
             npcView.Close();
         }
     }
 }
コード例 #5
0
    private void InitCoreManager()
    {
        RegisterLog();
        DontDestroyOnLoad(this.gameObject);
        log.Debug("Start game application...");
        GameWorld.GetInstance();
        LoggerView.GetInstance();
        CameraLayerManager.GetInstance();
        AssetLoader.GetInstance();
        ViewCameraManager.GetInstance().Init();
        LayerManager.GetInstance().Init();
        RemoteCallLogic.GetInstance();
        NGUIManager.GetInstance();

        LoginController.GetInstance();
        SceneLogic.GetInstance();
        PlayerController.GetInstance();
        BagLogic.GetInstance();
        NpcLogic.GetInstance();
        TimeManager.GetInstance();
        ViewManager.GetInstance();
        gameObject.AddComponent("CronJob");
        LoadResource();

        //ActiveRush.InitFx();



        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_g2"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao01_lipihuashantexiao"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_mingzhong2"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong_g"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_wuqifeixing"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao02_nuzhanbahuang_gongji"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_06_nuhou_shifa"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_05_zhenfei"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng_mingzhong"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_guaiwusiwang2"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_levelup"));

        AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan_yellow"), PLAYER_SEL_LoadComplete, AssetType.BUNDLER);
        AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan2_red"), NPC_SEL_LoadComplete, AssetType.BUNDLER);

        PreLoad.GetInstance().OnEnterScene();
        SelecterManager.GetInstance();
    }
コード例 #6
0
        public object OnOpenNpcPanelByID(params object[] objs)
        {
            int npcID = Convert.ToInt32(objs[0]);

            if (npcView == null)
            {
                npcView = new NpcDiaologView();
            }
            npcView.PannelVO = NpcLogic.GetInstance().GetNPCPanelInfo(npcID);
            npcView.Open();
            return(null);
        }
コード例 #7
0
        public object OnOpenNpcPanel(params object[] objs)
        {
            uint        npcSceneId = Convert.ToUInt32(objs[0]);
            SceneEntity npc        = SceneLogic.GetInstance().GetSceneObject(npcSceneId);

            if (npcView == null)
            {
                npcView = new NpcDiaologView();
            }
            npcView.PannelVO = NpcLogic.GetInstance().GetNPCPanelInfo((int)npc.TabID);
            npcView.Open();
            return(null);
        }
コード例 #8
0
ファイル: PathUtil.cs プロジェクト: moto2002/DinaGameClient
        public static void FindNpc(int npcID)
        {
            KNpcPos npcPos = NpcLogic.GetInstance().GetNpcPosByID(npcID);

            if (npcPos != null)
            {
                Vector3 rolePosition = MapUtils.GetMetreFromInt(npcPos.nPathX, npcPos.nPathZ, npcPos.nPathY);
                Goto(npcPos.MapID, rolePosition);

                KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(npcID);
                if (null != npcInfo && npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster)
                {
                    NPC_ID      = npcID;
                    bAutoAttack = true;
                }
                //SceneLogic.GetInstance().MainHero.property.CmdAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster);
            }
        }
コード例 #9
0
ファイル: PathUtil.cs プロジェクト: moto2002/DinaGameClient
        public static void FindNpcAndOpen(int npcID)
        {
            if (NpcLogic.GetInstance().CheckNpcNearby(npcID) == true)
            {
                EventDispatcher.GameWorld.Dispath(ControllerCommand.OPEN_NPC_PANEL_BYID, npcID);
                return;
            }

            KNpcPos npcPos = NpcLogic.GetInstance().GetNpcPosByID(npcID);

            if (npcPos != null)
            {
                NPC_ID = npcID;
                Vector3 rolePosition = MapUtils.GetMetreFromInt(npcPos.nPathX, npcPos.nPathZ, npcPos.nPathY);
                Goto(npcPos.MapID, rolePosition);

                KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(npcID);
                if (null != npcInfo)
                {
                    bAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster);
                }
                //SceneLogic.GetInstance().MainHero.property.CmdAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster);
            }
        }
コード例 #10
0
        private object UpdateMission(params object[] objs)
        {
            Dictionary <int, MissionInfo> curMission    = MissionLogic.GetInstance().GetCurrentMissionList();
            Dictionary <int, MissionInfo> canGetMission = MissionLogic.GetInstance().GetCanAcceptList();

            attackItem.SetActive(false);
            daliyItem.SetActive(false);
            mainItem.SetActive(false);
            mainInfo   = null;
            daliyInfo  = null;
            attackInfo = null;
            CollectObjLogic.GetInstance().ClearNeedCollectObjList();

            foreach (MissionInfo info in curMission.Values)
            {
                if (info.type == (int)MissionInfo.MissionType.MainMission)
                {
                    MainMisName.text = info.questName;
                    if (info.curStatus == MissionInfo.MisssionStatus.BeenAccepted)
                    {
                        MainCondition.text = info.condition + " <FF0000>(未完成)<->";
                    }
                    else if (info.curStatus == MissionInfo.MisssionStatus.Finish)
                    {
                        KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(info.submitNpcID);
                        MainCondition.text = " " + "<a:" + info.submitNpcID + ">" + "去找" + npcInfo.Name + "</a>" + " <ffa200>(已完成)<->";
                    }

                    mainInfo = info;
                    mainItem.SetActive(true);
                }
                else if (info.type == (int)MissionInfo.MissionType.DaliyMission)
                {
                    DaliyMisName.text = info.questName;
                    if (info.curStatus == MissionInfo.MisssionStatus.BeenAccepted)
                    {
                        DaliyCondition.text = info.condition + " <FF0000>(未完成)<->";
                    }
                    else if (info.curStatus == MissionInfo.MisssionStatus.Finish)
                    {
                        KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(info.submitNpcID);
                        DaliyCondition.text = " " + "<a:" + info.submitNpcID + ">" + "去找" + npcInfo.Name + "</a>" + " <ffa200>(已完成)<->";
                    }

                    daliyInfo = info;
                    attackItem.SetActive(true);
                }
                else if (info.type == (int)MissionInfo.MissionType.SubLineMission)
                {
                    AttackMisName.text = info.questName;
                    if (info.curStatus == MissionInfo.MisssionStatus.BeenAccepted)
                    {
                        AttackCondition.text = info.condition + " <FF0000>(未完成)<->";
                    }
                    else if (info.curStatus == MissionInfo.MisssionStatus.Finish)
                    {
                        KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(info.submitNpcID);
                        AttackCondition.text = " " + "<a:" + info.submitNpcID + ">" + "去找" + npcInfo.Name + "</a>" + " <ffa200>(已完成)<->";
                    }

                    attackInfo = info;
                    daliyItem.SetActive(true);
                }
            }

            foreach (MissionInfo info in canGetMission.Values)
            {
                if (info.type == (int)MissionInfo.MissionType.MainMission)
                {
                    MainMisName.text = info.questName;
                    KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(info.npcID);
                    MainCondition.text = " " + "<a:" + info.npcID + ">" + "去找" + npcInfo.Name + "</a>";
                    mainInfo           = info;
                    mainItem.SetActive(true);
                    //ImmediateButtonLabel.text = "<a:" + info.id + ">" + ImmediateButtonLabel.text;
                }
                else if (info.type == (int)MissionInfo.MissionType.DaliyMission)
                {
                    DaliyMisName.text = info.questName;
                    KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(info.npcID);
                    DaliyCondition.text = " " + "<a:" + info.npcID + ">" + "去找" + npcInfo.Name + "</a>";
                    daliyInfo           = info;
                    attackItem.SetActive(true);
                }
                else if (info.type == (int)MissionInfo.MissionType.SubLineMission)
                {
                    AttackMisName.text = info.questName;
                    KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(info.npcID);
                    AttackCondition.text = " " + "<a:" + info.npcID + ">" + "去找" + npcInfo.Name + "</a>";
                    attackInfo           = info;
                    daliyItem.SetActive(true);
                }
            }

            if (mainInfo != null)
            {
                if (mainInfo.curStatus == MissionInfo.MisssionStatus.BeenAccepted && mainInfo.subType == (int)MissionInfo.MissionSubType.Collect)
                {
                    int targetID;
                    if (TryGetIntIDFormString(mainInfo.condition, out targetID))
                    {
                        CollectObjLogic.GetInstance().AddNeedCollectObjID(targetID, mainInfo.id);
                    }
                }
            }

            if (daliyInfo != null)
            {
                if (daliyInfo.curStatus == MissionInfo.MisssionStatus.BeenAccepted && daliyInfo.subType == (int)MissionInfo.MissionSubType.Collect)
                {
                    int targetID;
                    if (TryGetIntIDFormString(daliyInfo.condition, out targetID))
                    {
                        CollectObjLogic.GetInstance().AddNeedCollectObjID(targetID, daliyInfo.id);
                    }
                }
            }

            if (attackInfo != null)
            {
                if (attackInfo.curStatus == MissionInfo.MisssionStatus.BeenAccepted && attackInfo.subType == (int)MissionInfo.MissionSubType.Collect)
                {
                    int targetID;
                    if (TryGetIntIDFormString(attackInfo.condition, out targetID))
                    {
                        CollectObjLogic.GetInstance().AddNeedCollectObjID(targetID, attackInfo.id);
                    }
                }
            }

            return(null);
        }
コード例 #11
0
        public void LoadConfigFile()
        {
            kparams = new KTabFile <KParams>("Settings/params", LoadComplet);
            ++ToBeLoadTotalCount;

            animEvent = new  KTabFile <KAminEvent>("Settings/skill/anim_event", LoadComplet);
            ++ToBeLoadTotalCount;

            localizationTexts = new KTabFile <KLocalizationText>("ClientSettings/localizationtext", LoadComplet);
            ++ToBeLoadTotalCount;

            itemTabInfos = new KTabFile <KTabLineItem>("ClientSettings/other", LoadComplet);
            ++ToBeLoadTotalCount;

            equipTabInfos = new KTabFile <KTabLineEquip>("ClientSettings/equip", LoadComplet);
            ++ToBeLoadTotalCount;

            equipStrengthenTab = new KTabFile <KEquipStrengthen>("Settings/item/equip_strengthen", LoadComplet);
            ++ToBeLoadTotalCount;

            equipSteptab = new KTabFile <KEquipStep>("Settings/item/equip_step", IntensifyLogic.GetInstance().EquipStepComplete, LoadComplet);
            ++ToBeLoadTotalCount;

            equipServerTab = new KTabFile <KTabServerEquip>("Settings/item/equip", LoadComplet);
            ++ToBeLoadTotalCount;

            equipClientTab = new KTabFile <KTabClientEquip>("ClientSettings/equip_client", LoadComplet);
            ++ToBeLoadTotalCount;

            equipSuitTab = new KTabFile <KTabEquipSuit>("Settings/item/equip_suit", LoadComplet);
            ++ToBeLoadTotalCount;

            showTabInfos = new KTabFile <KTabLineShowInfo>("ClientSettings/show", LoadComplet);
            ++ToBeLoadTotalCount;

            skillDisplay = new KTabFile <KSkillDisplay>("Settings/skill/skill_display", LoadComplet);
            ++ToBeLoadTotalCount;

            giftTabFile = new KTabFile <KGiftData>("Settings/gift", LoadComplet);
            ++ToBeLoadTotalCount;

            heroSetting = new KTabFile <KHeroSetting>("Settings/hero/hero", LoadComplet);
            ++ToBeLoadTotalCount;

            plotInfo = new KTabFile <KPlotInfo>("Settings/mission/plot_info", LoadComplet);
            ++ToBeLoadTotalCount;

            mapListSetting = new KTabFile <KMapListSetting>("Settings/map_list", LoadMapListComplet);
            ++ToBeLoadTotalCount;

            buffs = new KTabFile <KBuff>("Settings/skill/buff_info", GameApplication.BuffderLoadComplete, LoadComplet);
            ++ToBeLoadTotalCount;

            //   activeSkillList = new KTabFile<KActiveSkill>("Settings/skill/active_skill", KSkillManager.GetInstance().ActiveSkillLoadComplete, LoadComplet);
            activeSkillList = new KTabFile <KActiveSkill>("Settings/skill/active_skill", LoadComplet);
            ++ToBeLoadTotalCount;

            //   passiveSkillList = new KTabFile<KPassiveSkill>("Settings/skill/passive_skill", KSkillManager.GetInstance().PassiveSkillLoadComplete, LoadComplet);
            passiveSkillList = new KTabFile <KPassiveSkill>("Settings/skill/passive_skill", LoadComplet);
            ++ToBeLoadTotalCount;

            missionLoaclInfoList = new KTabFile <KMissionLoaclInfo>("Settings/quests", MissionLogic.GetInstance().MissionLoadComplete, LoadComplet);
            ++ToBeLoadTotalCount;

            missionDialogueList = new KTabFile <KMissionDialogue>("Settings/mission/dialogue", MissionLogic.GetInstance().DialogueLoadComplete, LoadComplet);
            ++ToBeLoadTotalCount;

            playerLevelSetting = new KTabFile <KPlayerLevelExpSetting>("Settings/player_level_exp", PlayerLevelExp.GetInstance().PlayerLevelExpLoadComplete, LoadComplet);
            ++ToBeLoadTotalCount;

            npcPoss = new KTabFile <KNpcPos>("ClientSettings/npc_pos", NpcLogic.GetInstance().NpcPosLoadComplete, LoadComplet);
            ++ToBeLoadTotalCount;

            clientConfig = new KIniFile("ClientSettings/config", LoadComplet);
            ++ToBeLoadTotalCount;

            resourceVersion = new KResourceVersion(LoadComplet);
            ++ToBeLoadTotalCount;

            pveList = new KTabFile <KPve>("Settings/pve", LoadComplet);
            ++ToBeLoadTotalCount;

            collectMissionInfo = new KTabFile <KCollectMissionInfo>("Settings/mission/collect_mission", LoadComplet);
            ++ToBeLoadTotalCount;
        }