示例#1
0
        public void ParseCsv(string[] csv)
        {
            int i = 0;

            //id
            id = csv.GetInt32(i++);
            // AI技能顺序
            aiPriority = csv.GetInt32(i++);
            //AItype
            string aiTypeStr = "";

            aiTypeStr = csv.GetString(i++);
            string[] aiTypeStrArray = aiTypeStr.Split(':');
            if (aiTypeStrArray.Length == 2)
            {
                aiTypeArray[0] = aiTypeStrArray[0].ToInt32();
                aiTypeArray[1] = aiTypeStrArray[1].ToInt32();
            }
            //Debug.LogFormat("=============aiTypeStr: {0}, {1}",id, aiTypeStr);
            // 使用次数
            useCount = csv.GetInt32(i++);
            // 是否上阵
            isSettledBuild = csv.GetBoolean(i++);
            // 目标建筑类型
            buildType = csv.GetInt32(i++);

            //effectId
            string effectIdStr;

            effectIdStr = csv.GetString(i++);
            string[] effectIdArray = effectIdStr.Split(',');
            //data
            string dataStr;

            dataStr = csv.GetString(i++);
            string[] dataStrArray = dataStr.Split(',');
            //growUp
            string growUPStr;

            growUPStr = csv.GetString(i++);
            string[] growUPStrArray = growUPStr.Split(',');
            //Debug.Log("========" + id + "=========" + growUPStr + "++++" + effectIdArray.Length);
            for (int idx = 0; idx < maxEffectId; ++idx)
            {
                if (effectIdArray.Length <= idx ||
                    dataStrArray.Length <= idx ||
                    growUPStrArray.Length <= idx)
                {
                    break;
                }

                CSkillEffectDataItem skillEffectDate = new CSkillEffectDataItem();
                skillEffectDate.id     = effectIdArray[idx].ToInt32();
                skillEffectDate.data   = dataStrArray[idx].ToSingle();
                skillEffectDate.growUp = growUPStrArray[idx].ToSingle();
                effectDataList.Add(skillEffectDate);
                if (mainEffectData == null)
                {
                    mainEffectData = skillEffectDate;
                }

                SkillWarEffectConf effect = War.model.GetSkillWarEffectConf(skillEffectDate.id);
                if (effect != null)
                {
                    skillEffectDate.type             = effect.type;
                    skillEffectDate.operation        = effect.operation;
                    skillEffectDate.camp             = effect.camp;
                    skillEffectDate.target           = effect.target;
                    skillEffectDate.range            = effect.range;
                    skillEffectDate.time             = effect.time;
                    skillEffectDate.addSoldierMax    = effect.addSoldierMax;
                    skillEffectDate.changePropertyId = effect.changePropertyId;
                    skillEffectDate.overlap          = effect.overlap;
                    skillEffectDate.animPathStart    = effect.animPathStart;
                    skillEffectDate.animPathEnd      = effect.animPathEnd;
                    skillEffectDate.buffAnimPath     = effect.buffAnimPath;
                    skillEffectDate.hurtCount        = effect.hurtCount;
                    skillEffectDate.isSend           = effect.isSend;
                    skillEffectDate.costHP           = effect.costHP;
                    skillEffectDate.costHPPer        = effect.costHPPer;
                }
                else
                {
                    //  Debug.LogFormat("<color=#ff0000>=======cant find skillEffectDate: {0}=======</color>", skillEffectDate.id);
                }
                //Debug.Log(string.Format("<color=green> effectdata={0}, {1}, {2}, type:{3} id:{4}</color>",
                //                skillEffectDate.id, skillEffectDate.data, skillEffectDate.growUp, skillEffectDate.type,
                //                skillEffectDate.id));
            }
            consume = csv.GetInt32(i++);
            skillCd = csv.GetInt32(i++);
            //skill2Id = csv.GetInt32(i++);
            heroVoicePath   = csv.GetString(i++);
            musicEffectPath = csv.GetString(i++);

            skillAvatar = csv.GetInt32(i++);

            skillName     = csv.GetString(i++);
            skillDescribe = csv.GetString(i++);

            //skillName2 = csv.GetString(i++);
            //skillDescribe2 = csv.GetString(i++);

            displayConfig = War.model.GetSkillWarDisplayConf(id);
            if (displayConfig != null)
            {
                skillAvatar = displayConfig.avatarId;
            }
            else
            {
//				Debug.LogErrorFormat ("skillId={0}, displayConfig={1}", id, displayConfig);
            }

            War.model.AddSkillWarConf(this);
        }
示例#2
0
 public void AddSkillWarEffectConf(SkillWarEffectConf skillWarEffectConf)
 {
     skillWarEffectConfDic.Add(skillWarEffectConf.id, skillWarEffectConf);
 }