Ejemplo n.º 1
0
        public static CampInfo InitInfo(int campID)
        {
            CampInfo info  = new CampInfo();
            var      _meta = CampModule.GetCampDataByKey(campID);

            if (_meta != null)
            {
                info.CampID   = _meta.CampID;
                info.campName = MultiLanguage.Instance.GetTextValue(_meta.CampName);
                info.campDesc = MultiLanguage.Instance.GetTextValue(_meta.CampDesc);

                info.campIconPath    = _meta.CampIcon;
                info.campBGSmallPath = _meta.CampBGSmall;

                info.hardLevel             = _meta.HardLevel;
                info.defualtHardLevelValue = _meta.DefaultHardLevel;

                info.creedInfo     = CampCreedInfo.InitInfo(_meta.CreedID);
                info.attributeInfo = CampModule.GetCampAttribueInfoList(_meta.CampID);

                ///Init DefaultLeader
                info.campLeaderList = CampModule.GetCampDefaultLeaderList(_meta.CampID);

                return(info);
            }
            DebugPlus.LogError("[CampInfo] : Init Fail! campID=" + campID);
            return(null);
        }
Ejemplo n.º 2
0
        public void SetUpItem(GeneralInfoItemType type, object param, bool showText = true)
        {
            this.type = type;
            if (type == GeneralInfoItemType.Camp_Creed)
            {
                try
                {
                    CampCreedInfo info = (CampCreedInfo)param;
                    keyParam         = info.creedID;
                    iconTrans.sprite = Utility.LoadSprite(info.creedIconPath);
                    textTrans.text   = showText ? info.creedName : "";
                }
                catch { return; }
            }
            else if (type == GeneralInfoItemType.Camp_Attribute)
            {
                try
                {
                    CampAttributeInfo info = (CampAttributeInfo)param;
                    keyParam         = info.attributeID;
                    iconTrans.sprite = Utility.LoadSprite(info.iconPath);
                    textTrans.text   = showText ? info.attributeName : "";
                }
                catch { return; }
            }
            else if (type == GeneralInfoItemType.Leader_Skill)
            {
                try
                {
                    LeaderSkillInfo info = (LeaderSkillInfo)param;
                    keyParam         = info.skillID;
                    iconTrans.sprite = Utility.LoadSprite(info.skillIconPath);
                    textTrans.text   = showText ? info.skillName : "";
                }
                catch { return; }
            }
            else if (type == GeneralInfoItemType.Leader_Attribute)
            {
                try
                {
                    LeaderAttributeInfo info = (LeaderAttributeInfo)param;
                    keyParam         = info.attributeID;
                    iconTrans.sprite = Utility.LoadSprite(info.attributeIconPath);
                    textTrans.text   = showText ? info.attributeName : "";
                }
                catch { return; }
            }

            RefrehsContentSize();
            //FadeAnim
            var canvas = transform.SafeGetComponent <CanvasGroup>();

            canvas.alpha = 0;
            canvas.DoCanvasFade(1, 0.8f);
        }
Ejemplo n.º 3
0
        public static CampCreedInfo InitInfo(int creedID)
        {
            CampCreedInfo info = new CampCreedInfo();
            var           meta = CampModule.GetCampCreedDataByKey(creedID);

            if (meta != null)
            {
                info.creedID       = creedID;
                info.creedName     = MultiLanguage.Instance.GetTextValue(meta.CreedName);
                info.creedDesc     = MultiLanguage.Instance.GetTextValue(meta.CreedDesc);
                info.creedIconPath = meta.CreedIcon;
                return(info);
            }
            DebugPlus.LogError("[CampCreedInfo] : Init Fail! creedID=" + creedID);
            return(null);
        }