Пример #1
0
        public static LeaderInfo CreateLeaderInfo_Preset(int leaderID)
        {
            LeaderInfo info = new LeaderInfo();
            var        meta = LeaderModule.GetLeaderPresetDataByKey(leaderID);

            if (meta == null)
            {
                DebugPlus.LogError("CreateLeaderInfo_Preset Fail! leaderID=" + leaderID);
                return(null);
            }
            info.leaderID   = meta.LeaderID;
            info.leaderName = MultiLanguage.Instance.GetTextValue(meta.LeaderName);
            info.leaderDesc = MultiLanguage.Instance.GetTextValue(meta.LeaderDesc);
            info.currentAge = meta.Age;
            info.Gender     = (byte)meta.Gender;

            info.speciesInfo       = LeaderSpeciesInfo.InitSpeciesInfo(meta.SpeciesID);
            info.creedInfo         = LeaderCreedInfo.InitCreedInfo(meta.CreedID);
            info.skillInfoList     = LeaderModule.GetLeaderSkillInfoDefault(leaderID);
            info.attributeInfoList = LeaderModule.GetLeaderAttributePreset(leaderID);
            info.birthlandInfo     = LeaderBirthlandInfo.InitBirthlandInfo(meta.BirthlandID);
            info.storyInfoList     = LeaderModule.GetLeaderPresetStory(leaderID);

            info.portraitInfo = LeaderPortraitInfo.Generate_PresetInfo(meta.Portrait_BG, meta.Portrait_Cloth, meta.Portrait_Ear, meta.Portrait_Hair, meta.Portrait_Eyes, meta.Portrait_Face, meta.Portrait_Mouth, meta.Portrait_Nose);

            return(info);
        }
Пример #2
0
        public static LeaderCreedInfo InitCreedInfo(int creedID)
        {
            LeaderCreedInfo info = new LeaderCreedInfo();
            var             meta = LeaderModule.GetLeaderCreedDataByKey(creedID);

            if (meta == null)
            {
                DebugPlus.LogError("Init LeaderCreedInfo Error! creedID=" + creedID);
                return(null);
            }
            info.creedID       = meta.CreedID;
            info.creedName     = MultiLanguage.Instance.GetTextValue(meta.CreedName);
            info.creedDesc     = MultiLanguage.Instance.GetTextValue(meta.CreedDesc);
            info.creedIconPath = meta.IconPath;
            return(info);
        }
Пример #3
0
 void SetUpCreed(LeaderCreedInfo creedInfo)
 {
     transform.FindTransfrom("Content/LeaderCreed/Name").SafeGetComponent <Text>().text         = creedInfo.creedName;
     transform.FindTransfrom("Content/LeaderCreed/Name/Icon").SafeGetComponent <Image>().sprite = Utility.LoadSprite(creedInfo.creedIconPath);
 }