Beispiel #1
0
 public bool CreateLeaderModel(int leaderiD)
 {
     if (LeaderModule.GetLeaderPresetDataByKey(leaderiD) != null)
     {
         _leaderID = leaderiD;
         return(true);
     }
     return(false);
 }
Beispiel #2
0
        void InitBaseData()
        {
            totalSpeciesInfoList = LeaderModule.GetAllSpecies();
            portraitSpriteDic    = new Dictionary <LeaderPortraitType, List <Config.LeaderPortraitItemConfig> >();
            customItemList       = new List <LeaderPortraitCustomItem>();

            InitCustomPortraitContent();
            InitSpeciesDropDown();

            ///InitSpeciesDefault
            if (totalSpeciesInfoList != null && totalSpeciesInfoList.Count != 0)
            {
                OnSpeciesDropDownValueChange(0);
            }
        }
Beispiel #3
0
        void OnSpeciesDropDownValueChange(int index)
        {
            if (index > totalSpeciesInfoList.Count - 1)
            {
                return;
            }
            var info = totalSpeciesInfoList[index];

            currentSelectSpeciesID = info.speciesID;
            ///Refresh ImageDic
            portraitSpriteDic.Clear();
            foreach (LeaderPortraitType type in Enum.GetValues(typeof(LeaderPortraitType)))
            {
                var list = LeaderModule.GetLeagalPortraitImte(type, currentSelectSpeciesID, 1);
                portraitSpriteDic.Add(type, list);
            }
            RefreshCustomPortraitContent();
        }
        bool RefreshLeaderInfo(LeaderInfo info)
        {
            if (info == null)
            {
                return(false);
            }
            currentSelectLeaderInfo = info;
            _nameText.text          = info.leaderName;
            _speciesText.text       = info.speciesInfo.speciesName;
            _ageText.text           = info.currentAge.ToString();
            _sexText.text           = LeaderModule.GetLeaderGenderText(info.Gender);
            _birthlandText.text     = info.birthlandInfo.landName;
            _creedText.text         = info.creedInfo.creedName;

            SetUpAttribute(info.attributeInfoList);
            SetUpSkill(info.skillInfoList);
            SetUpStory(info.storyInfoList);
            return(true);
        }
Beispiel #5
0
        private void SetUpDialog()
        {
            if (_info == null)
            {
                return;
            }
            //SetUpPortrait
            Transform.FindTransfrom("Content/DetailPanel/LeaderPortrait").SafeGetComponent <LeaderPortraitUI>().SetUpItem(_info.portraitInfo);
            _nameText.text      = _info.leaderName;
            _speciesText.text   = _info.speciesInfo.speciesName;
            _ageText.text       = _info.currentAge.ToString();
            _sexText.text       = LeaderModule.GetLeaderGenderText(_info.Gender);
            _birthlandText.text = _info.birthlandInfo.landName;
            _creedText.text     = _info.creedInfo.creedName;

            SetUpAttribute(_info.attributeInfoList);
            SetUpSkill(_info.skillInfoList);
            SetUpStory(_info.storyInfoList);
        }