Esempio n. 1
0
    private void OnUpdateAvatarExp()
    {
        XCharacter role   = RoleModule.Instance.GetCurPlayer();
        int        maxExp = ReadCfgRoleLevel.GetDataById(role.Level).RequireExp;

        mBar3.value = (role.CurExp * 1f) / maxExp;
    }
Esempio n. 2
0
    private void OnUpdateAvatarExp()
    {
        XCharacter role   = GTGlobal.Main;
        int        maxExp = ReadCfgRoleLevel.GetDataById(role.Level).RequireExp;

        mBar3.value = (role.CurExp * 1f) / maxExp;
    }
Esempio n. 3
0
    private void OnAck_AddHeroExp(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckAddPlayerExp        ack = Serializer.Deserialize <AckAddPlayerExp>(ms);

        XCharacter player   = RoleModule.Instance.GetCurPlayer();
        int        oldLevel = player.Level;

        int maxLevel = ReadCfgRoleLevel.Count;

        if (player.Level >= maxLevel)
        {
            return;
        }
        player.CurExp += ack.Exp;
        DRoleLevel levelDB = ReadCfgRoleLevel.GetDataById(player.Level);

        while (player.CurExp >= levelDB.RequireExp)
        {
            player.CurExp -= levelDB.RequireExp;
            player.Level++;
            if (player.Level >= maxLevel)
            {
                player.CurExp = 0;
                break;
            }
            levelDB = ReadCfgRoleLevel.GetDataById(player.Level);
        }
        DataDBSRole.Update(player.Id, player);
        GTItemHelper.ShowExpTip(ack.Exp);


        int newLevel = player.Level;

        if (newLevel > oldLevel)
        {
            CharacterManager.Instance.SyncMainPlayerData(ESyncDataType.TYPE_LEVEL);
            GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_HEROLEVEL);
            GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_FIGHTVALUE);
        }
        GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_HEROEXP);
    }
Esempio n. 4
0
    private void ShowView()
    {
        for (int i = 0; i < moneyViewList.Count; i++)
        {
            MoneyView mv = moneyViewList[i];
            DItem     db = ReadCfgItem.GetDataById(i + 1);
            GTItemHelper.ShowItemTexture(mv.moneyTexture, db.Id);
            mv.moneyNumText.text = GTDataManager.Instance.GetItemCountById(db.Id).ToString();
        }

        XCharacter role        = GTGlobal.Main;
        DRoleLevel heroLevelDB = ReadCfgRoleLevel.GetDataById(role.Level);

        heroName.text    = role.Name;
        heroLevel.text   = GTTools.Format("等级 {0}", role.Level);
        heroVIP.text     = GTTools.Format("VIP {0}", role.VipLevel);
        heroExpNum.text  = GTTools.Format("{0}/{1}", role.CurExp, heroLevelDB.RequireExp);
        heroExpBar.value = role.CurExp / (heroLevelDB.RequireExp * 1f);
        int fightValue = GTAttrHelper.GetFightValue(role);

        heroFightValue.text = GTTools.Format("战斗力 {0}", fightValue);
    }
Esempio n. 5
0
    public override void Init()
    {
        ReadCfgLocalString.Read("Text/Local/Data_LocalString");
        ReadCfgCurve.Read("Text/Local/Data_Curve");

        ReadCfgStageMount.Read("Text/Local/Data_StageMount");
        ReadCfgStagePartner.Read("Text/Local/Data_StagePartner");
        ReadCfgStagePet.Read("Text/Local/Data_StagePet");
        ReadCfgStageRelics.Read("Text/Local/Data_StageRelics");
        ReadCfgStageRole.Read("Text/Local/Data_StageRole");

        ReadCfgSearch.Read("Text/Local/Data_Search");
        ReadCfgRandomName.Read("Text/Local/Data_RandomNames");

        ReadCfgProperty.Read("Text/Data/Data_Property");
        ReadCfgQuality.Read("Text/Data/Data_Quality");

        ReadCfgItem.Read("Text/Data/Data_Item");
        ReadCfgEquip.Read("Text/Data/Data_Equip");
        ReadCfgAction.Read("Text/Data/Data_Action");

        ReadCfgRole.Read("Text/Data/Data_Role");
        ReadCfgRoleLevel.Read("Text/Data/Data_RoleLevel");

        ReadCfgEquip.Read("Text/Data/Data_Equip");
        ReadCfgEquipAdvance.Read("Text/Data/Data_EquipAdvance");
        ReadCfgEquipAdvanceCost.Read("Text/Data/Data_EquipAdvanceCost");
        ReadCfgEquipStreng.Read("Text/Data/Data_EquipStrengthen");
        ReadCfgEquipStrengLevel.Read("Text/Data/Data_EquipStrengthenLevel");
        ReadCfgEquipStar.Read("Text/Data/Data_EquipStar");
        ReadCfgEquipSuit.Read("Text/Data/Data_EquipSuit");

        ReadCfgGem.Read("Text/Data/Data_Gem");
        ReadCfgGemLevel.Read("Text/Data/Data_GemLevel");
        ReadCfgGemSuit.Read("Text/Data/Data_GemSuit");

        ReadCfgAward.Read("Text/Data/Data_Award");

        ReadCfgCopyMainChapter.Read("Text/Data/Data_CopyMainChapter");
        ReadCfgCopy.Read("Text/Data/Data_Copy");

        ReadCfgEffect.Read("Text/Data/Data_Effect");
        ReadCfgRelics.Read("Text/Data/Data_Relics");
        ReadCfgMachine.Read("Text/Data/Data_Machine");

        ReadCfgActorGroup.Read("Text/Data/Data_ActorGroup");
        ReadCfgActor.Read("Text/Data/Data_Actor");
        ReadCfgActorRace.Read("Text/Data/Data_ActorRace");
        ReadCfgActorModel.Read("Text/Data/Data_ActorModel");

        ReadCfgStore.Read("Text/Data/Data_Store");
        ReadCfgStoreType.Read("Text/Data/Data_StoreType");

        ReadCfgPet.Read("Text/Data/Data_Pet");
        ReadCfgPetLevel.Read("Text/Data/Data_PetLevel");

        ReadCfgPartner.Read("Text/Data/Data_Partner");
        ReadCfgPartnerLevel.Read("Text/Data/Data_PartnerLevel");
        ReadCfgPartnerWake.Read("Text/Data/Data_PartnerWake");
        ReadCfgPartnerAdvance.Read("Text/Data/Data_PartnerAdvance");
        ReadCfgPartnerWash.Read("Text/Data/Data_PartnerWash");
        ReadCfgPartnerFetter.Read("Text/Data/Data_PartnerFetter");
        ReadCfgPartnerStar.Read("Text/Data/Data_PartnerStar");

        ReadCfgTask.Read("Text/Data/Data_Task");
        ReadCfgAdventure.Read("Text/Data/Data_Adventure");
        ReadCfgSkillTalent.Read("Text/Data/Data_SkillTalent");
        ReadCfgMine.Read("Text/Data/Data_Mine");
        ReadCfgSkill.Read("Text/Data/Data_Skill");
        ReadCfgVideo.Read("Text/Data/Data_Video");
        ReadCfgDialogue.Read("Text/Data/Data_Dialogue");

        ActBuffSystem.Read("Text/Buff/Buff");
    }