| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735 |
- using System;
- using System.Collections.Generic;
- public struct SkillStatistics
- {
- public string skillIcon;
- public int skillType;
- public int skillId;
- public int skillLevel;
- public int cnt;
- public int breakCnt;
- public int damage;
- public int heal;
- public int absorb;
- public int critCnt;
- public int beBlockCnt;
- public int beDodgeCnt;
- public int bePerfectDodgeCnt;
- public int createdCnt;
- public List<float> castingTimeList;
- public void Casting(float castingTime)
- {
- if (castingTimeList == null)
- castingTimeList = new List<float>();
- castingTimeList.Add(castingTime);
- cnt++;
- }
- public void AddCreateCnt()
- {
- createdCnt++;
- }
- public void ResetCreateCnt()
- {
- createdCnt = 0;
- }
- }
- public class FighterStatistics
- {
- public ulong fighterInstId;
- public long fighterId;
- public long usedPetId;
- public string actorName;
- public string jobIcon;
- public string headIcon;
- public int level;
- public int damage = 0; //输出
- public int heal = 0; //治疗
- public int hurt = 0; //受伤
- public int addSp = 0;
- public int reflectdamage = 0; //反弹伤害
- public int basedamage = 0; //基础输出
- public int naturedamage = 0;//元素输出
- public int petdamage = 0; //宠物输出
- public float basedamagePercent = 0; //基础输出比例
- public float naturedamagePercent = 0;//元素输出比例
- public float petdamagePercent = 0; //宠物输出比例
- public float damagePercent = 0;
- public float healPercent = 0;
- public float hurtPercent = 0;
- public float heroDamagePercent = 0;
- public float heroHealPercent = 0;
- public float heroHurtPercent = 0;
- public int critCnt = 0;
- public int blockCnt = 0;
- public int dodgeCnt = 0;
- public int beCritCnt = 0;
- public int beBlockCnt = 0;
- public int beDodgeCnt = 0;
- public int buffCnt = 0;
- public SkillStatistics[] skillStatistics;
- private int mBeginFrame = 0;
- private bool mDirty = false;
- public bool Dirty
- {
- get { return mDirty; }
- set { mDirty = value; }
- }
- public FighterStatistics(Fighter fighter, int frameCnt)
- {
- actorName = fighter.Name;
- jobIcon = fighter.Actor.ProfessionIcon;
- headIcon = fighter.Actor.HeadIcon;
- level = fighter.Actor.Level;
- mBeginFrame = frameCnt;
- fighterInstId = fighter.InstanceId;
- fighterId = fighter.Id;
- usedPetId = fighter.UsedPetId;
- skillStatistics = new SkillStatistics[5];
- for (int i = 0; i < skillStatistics.Length; i++)
- {
- skillStatistics[i].skillType = i;
- }
- }
- public void StatHitInfo(SkillHitFighterInfo hitInfo)
- {
- if (hitInfo.Caster != null && hitInfo.Caster.InstanceId == fighterInstId)
- {
- if(hitInfo.Skill != null && hitInfo.Skill.SkillTypeID>=0 && hitInfo.Skill.SkillTypeID < skillStatistics.Length)
- {
- int skillType = hitInfo.Skill.SkillTypeID;
- if (hitInfo.IsImmunity)
- skillStatistics[skillType].beBlockCnt++;
- else if (hitInfo.IsDodge)
- skillStatistics[skillType].beDodgeCnt++;
- else if (hitInfo.IsPerfectDodge)
- skillStatistics[skillType].bePerfectDodgeCnt++;
- else
- {
- if (hitInfo.IsCrit)
- {
- critCnt++;
- skillStatistics[skillType].critCnt++;
- }
- if (hitInfo.Damage > 0)
- {
- int hitDamage = UnityEngine.Mathf.RoundToInt(hitInfo.Damage);
- damage += hitDamage;
- basedamage += UnityEngine.Mathf.RoundToInt(hitInfo.BaseDamge);
- naturedamage += UnityEngine.Mathf.RoundToInt(hitInfo.NatureDamge);
- skillStatistics[skillType].damage += hitDamage;
- }
- }
- }
- else
- {
- if (hitInfo.Damage > 0)
- {
- int hitDamage = UnityEngine.Mathf.RoundToInt(hitInfo.Damage);
- damage += hitDamage;
- basedamage += UnityEngine.Mathf.RoundToInt(hitInfo.BaseDamge);
- naturedamage += UnityEngine.Mathf.RoundToInt(hitInfo.NatureDamge);
- }
- }
- mDirty = true;
- }
- }
- public void StatOtherDamage(Fighter f, int dmg)
- {
- if (f != null && f.InstanceId == fighterInstId && dmg > 0)
- {
- damage += dmg;
- mDirty = true;
- }
- }
- public void StatReflectInfo(Fighter f,int reflectDamage)
- {
- if(f != null && f.InstanceId == fighterInstId && reflectDamage > 0)
- {
- damage += reflectDamage;
- reflectdamage += reflectDamage;
- mDirty = true;
- }
- }
- public void StatBeHitInfo(SkillHitFighterInfo hitInfo)
- {
- if (hitInfo.Target != null && hitInfo.Target.InstanceId == fighterInstId)
- {
- if (hitInfo.IsImmunity)
- blockCnt++;
- else if (hitInfo.IsDodge)
- dodgeCnt++;
- else if (hitInfo.IsCrit)
- beCritCnt++;
- if(hitInfo.Attack > 0)
- {
- hurt += (int)hitInfo.Attack;
- }
- mDirty = true;
- }
- }
- public void StatReflectHurtInfo(Fighter f,int reflectHurt)
- {
- if (reflectHurt == 0) return;
- if(f != null && f.InstanceId == fighterInstId)
- {
- hurt += reflectHurt;
- }
- mDirty = true;
- }
- public void StatHealInfo(Fighter f,int healHp)
- {
- if(f != null && f.InstanceId == fighterInstId)
- {
- heal += healHp;
- mDirty = true;
- }
- }
- public void StatBuffInfo(Fighter f, bool negative)
- {
- if(f!=null && f.InstanceId == fighterInstId)
- {
- buffCnt++;
- mDirty = true;
- }
- }
- public void StatSPInfo(Fighter f, int sp)
- {
- if(f.InstanceId == fighterInstId)
- {
- addSp += sp;
- mDirty = true;
- }
- }
- public void OnEnterSkill (Fighter fighter, int skillType,string skillIcon,int skillId,int skillLevel)
- {
- skillStatistics[skillType].skillIcon = skillIcon;
- skillStatistics[skillType].skillId = skillId;
- skillStatistics[skillType].skillLevel = skillLevel;
- skillStatistics[skillType].Casting((BattleMgr.Instance.Battle.CurBattleField.BattleFrame - mBeginFrame)/Constants.frame_to_time);
- mDirty = true;
- }
- public void OnBreakSkill (Fighter fighter, int skillType)
- {
- //skillStatistics [skillType].breakCnt++;
- }
- }
- public class BattleStatistics
- {
- private List<FighterStatistics> mEnemyPetStatistics;
- private List<FighterStatistics> mFriendPetStatistics;
- private List<FighterStatistics> mEnemyStatistics;
- private List<FighterStatistics> mFriendStatistics;
- private float mBeginTime;
- private float mEndTime = 0;
- private int mBeginFrame = 0;
- private int mEndFrame = 0;
- private float factorA = 0;
- private float factorB = 0;
- private float factorC = 0;
- private bool bStarted = false;
- public float BeginTime
- {
- get { return mBeginTime; }
- }
- public float EndTime
- {
- get { return mEndFrame / Constants.frame_to_time; }
- }
- public List<FighterStatistics> FriendStatistics
- {
- get { return mFriendStatistics; }
- }
- public List<FighterStatistics> EnemyStatistics
- {
- get { return mEnemyStatistics; }
- }
- public bool Exist
- {
- get { return mFriendStatistics!=null && mFriendStatistics.Count > 0; }
- }
- public float PassedTime
- {
- get
- {
- if (null == BattleMgr.Instance.Battle)
- return 0;
- if (null == BattleMgr.Instance.Battle.CurBattleField)
- return 0;
- return (BattleMgr.Instance.Battle.CurBattleField.BattleFrame - mBeginFrame)/Constants.frame_to_time;
- }
- }
- public BattleStatistics()
- {
- factorB = GlobalConfig.Instance.GetConfigFloatValue(190);
- factorA = GlobalConfig.Instance.GetConfigFloatValue(191);
- factorC = GlobalConfig.Instance.GetConfigFloatValue(192);
- }
- public void Start()
- {
- bStarted = true;
- Clear();
- mBeginFrame = BattleMgr.Instance.Battle.CurBattleField.BattleFrame;
- }
- public void End()
- {
- if(bStarted)
- {
- var battle = BattleMgr.Instance.Battle;
- mEndFrame = battle.CurBattleField.BattleFrame - mBeginFrame;
- bStarted = false;
- }
- }
- public void Clear()
- {
- mEndFrame = 0;
- if (mEnemyStatistics != null)
- {
- mEnemyStatistics.Clear();
- }
- if(mFriendStatistics!=null)
- {
- mFriendStatistics.Clear();
- }
- if(mEnemyPetStatistics != null)
- {
- mEnemyPetStatistics.Clear();
- }
- if(mFriendPetStatistics != null)
- {
- mFriendPetStatistics.Clear();
- }
- }
- public FighterStatistics GetFighterStatistics (Fighter fighter)
- {
- if (bStarted == false) return null;
- if (fighter == null) return null;
- if(fighter.TeamSide == eTeamType.Friend)
- {
- if(fighter.IsPet)
- {
- if(mFriendPetStatistics == null)
- mFriendPetStatistics = new List<FighterStatistics>();
- for (int idx = 0; idx < mFriendPetStatistics.Count; idx++)
- {
- if (mFriendPetStatistics[idx].fighterInstId == fighter.InstanceId)
- {
- return mFriendPetStatistics[idx];
- }
- }
- FighterStatistics statistics = new FighterStatistics(fighter, mBeginFrame);
- mFriendPetStatistics.Add(statistics);
- return statistics;
- }
- else
- {
- if (mFriendStatistics == null)
- mFriendStatistics = new List<FighterStatistics>();
- for (int idx = 0; idx < mFriendStatistics.Count; idx++)
- {
- if (mFriendStatistics[idx].fighterInstId == fighter.InstanceId)
- {
- return mFriendStatistics[idx];
- }
- }
- FighterStatistics statistics = new FighterStatistics(fighter, mBeginFrame);
- mFriendStatistics.Add(statistics);
- return statistics;
- }
- }else if(fighter.TeamSide == eTeamType.Enemy)
- {
- if(fighter.IsPet)
- {
- if (mEnemyPetStatistics == null)
- mEnemyPetStatistics = new List<FighterStatistics>();
- for (int idx = 0; idx < mEnemyPetStatistics.Count; idx++)
- {
- if (mEnemyPetStatistics[idx].fighterInstId == fighter.InstanceId)
- {
- return mEnemyPetStatistics[idx];
- }
- }
- FighterStatistics statistics = new FighterStatistics(fighter, mBeginFrame);
- mEnemyPetStatistics.Add(statistics);
- return statistics;
- }
- else
- {
- if (mEnemyStatistics == null)
- mEnemyStatistics = new List<FighterStatistics>();
- for (int idx = 0; idx < mEnemyStatistics.Count; idx++)
- {
- if (mEnemyStatistics[idx].fighterInstId == fighter.InstanceId)
- {
- return mEnemyStatistics[idx];
- }
- }
- FighterStatistics statistics = new FighterStatistics(fighter, mBeginFrame);
- mEnemyStatistics.Add(statistics);
- return statistics;
- }
- }
- return null;
- }
- public void AnalyzeData()
- {
- if (bStarted == false) return;
- bool notify = false;
- if(mEnemyStatistics != null)
- {
- float totalDamage = 0;
- float totalHeal = 0;
- float totalHurt = 0;
- float totalBuffCnt = 0;
- float totalSp = 0;
- for(int idx =0; idx < mEnemyStatistics.Count;idx++)
- {
- var enemy = mEnemyStatistics[idx];
- if (null == enemy)
- continue;
- totalDamage += enemy.reflectdamage + enemy.basedamage + enemy.naturedamage;
- totalHeal += enemy.heal;
- totalHurt += enemy.hurt;
- totalBuffCnt += enemy.buffCnt;
- totalSp += enemy.addSp;
- }
- if(mEnemyPetStatistics != null)
- {
- for (int idx = 0; idx < mEnemyPetStatistics.Count; idx++)
- {
- var pet = mEnemyPetStatistics[idx];
- if (null == pet)
- continue;
- totalDamage += pet.reflectdamage + pet.basedamage + pet.naturedamage;
- totalHeal += pet.heal;
- totalHurt += pet.hurt;
- totalBuffCnt += pet.buffCnt;
- totalSp += pet.addSp;
- }
- }
- float avgPercent = 1.0f / mEnemyStatistics.Count;
- for (int idx = 0; idx < mEnemyStatistics.Count;idx++)
- {
- var enemy = mEnemyStatistics[idx];
- if (null == enemy)
- continue;
- if(enemy.usedPetId> 0)
- {
- var petStat = GetPetStatistics(enemy.usedPetId, eTeamType.Enemy);
- int pethurt = 0;
- int petreflectdamage = 0;
- int petbasedamage = 0;
- int petnaturedamage = 0;
- int petheal = 0;
- int petbuffCnt = 0;
- int petaddSp = 0;
- if (null != petStat)
- {
- pethurt = petStat.hurt;
- petreflectdamage = petStat.reflectdamage;
- petbasedamage = petStat.basedamage;
- petnaturedamage = petStat.naturedamage;
- petheal = petStat.heal;
- petbuffCnt = petStat.buffCnt;
- petaddSp = petStat.addSp;
- }
- enemy.petdamage = petreflectdamage + petbasedamage + petnaturedamage;
- enemy.damage = enemy.reflectdamage + enemy.basedamage + enemy.naturedamage;
- enemy.damagePercent = totalDamage > 0 ? (enemy.damage + enemy.petdamage) / totalDamage : 0;
- enemy.hurtPercent = totalHurt > 0 ? (enemy.hurt + pethurt) / totalHurt : 0;
- enemy.heroDamagePercent = totalDamage > 0 ? enemy.damage / totalDamage : 0;
- enemy.heroHurtPercent = totalHurt > 0 ? enemy.hurt / totalHurt : 0;
- float percent1 = totalHeal > 0 ? (enemy.heal + petheal) / totalHeal : avgPercent;
- float percent2 = totalBuffCnt > 0 ? (enemy.buffCnt + petbuffCnt) / totalBuffCnt : avgPercent;
- float percent3 = totalSp > 0 ? (enemy.addSp + petaddSp) / totalSp : avgPercent;
- enemy.healPercent = factorA * percent1 + factorB * percent2 + factorC * percent3;
- float percent4 = totalHeal > 0 ? enemy.heal / totalHeal : avgPercent;
- float percent5 = totalBuffCnt > 0 ? enemy.buffCnt / totalBuffCnt : avgPercent;
- float percent6 = totalSp > 0 ? enemy.addSp / totalSp : avgPercent;
- enemy.heroHealPercent = factorA * percent4 + factorB * percent5 + factorC * percent6;
- }
- else
- {
- enemy.petdamage = 0;
- enemy.damage = enemy.reflectdamage + enemy.basedamage + enemy.naturedamage;
- enemy.damagePercent = totalDamage > 0 ? enemy.damage / totalDamage : 0;
- enemy.hurtPercent = totalHurt > 0 ? enemy.hurt / totalHurt : 0;
- enemy.heroDamagePercent = enemy.damagePercent;
- enemy.heroHurtPercent = enemy.hurtPercent;
- float percent1 = totalHeal > 0 ? enemy.heal / totalHeal : avgPercent;
- float percent2 = totalBuffCnt > 0 ? enemy.buffCnt / totalBuffCnt : avgPercent;
- float percent3 = totalSp > 0 ? enemy.addSp / totalSp : avgPercent;
- enemy.healPercent = factorA * percent1 + factorB * percent2 + factorC * percent3;
- enemy.heroHealPercent = enemy.healPercent;
- }
-
- if (enemy.Dirty)
- {
- notify = true;
- enemy.Dirty = false;
- }
- }
- }
- if(mFriendStatistics != null)
- {
- float totalDamage = 0;
- float totalHeal = 0;
- float totalHurt = 0;
- float totalBuffCnt = 0;
- float totalSp = 0;
- for (int idx = 0; idx < mFriendStatistics.Count; idx++)
- {
- var friend = mFriendStatistics[idx];
- if (null == friend)
- continue;
- totalDamage += friend.reflectdamage + friend.basedamage + friend.naturedamage;
- totalHeal += friend.heal;
- totalHurt += friend.hurt;
- totalBuffCnt += friend.buffCnt;
- totalSp += friend.addSp;
- }
- if (mFriendPetStatistics != null)
- {
- for (int idx = 0; idx < mFriendPetStatistics.Count; idx++)
- {
- var pet = mFriendPetStatistics[idx];
- if (null == pet)
- continue;
- totalDamage += pet.reflectdamage + pet.basedamage + pet.naturedamage;
- totalHeal += pet.heal;
- totalHurt += pet.hurt;
- totalBuffCnt += pet.buffCnt;
- totalSp += pet.addSp;
- }
- }
- float avgPercent = 1.0f / mFriendStatistics.Count;
- for (int idx = 0; idx < mFriendStatistics.Count; idx++)
- {
- var friend = mFriendStatistics[idx];
- if (null == friend)
- continue;
- if (friend.usedPetId > 0)
- {
- var petStat = GetPetStatistics(friend.usedPetId, eTeamType.Friend);
- int pethurt = 0;
- int petreflectdamage = 0;
- int petbasedamage = 0;
- int petnaturedamage = 0;
- int petheal = 0;
- int petbuffCnt = 0;
- int petaddSp = 0;
- if (null != petStat)
- {
- pethurt = petStat.hurt;
- petreflectdamage = petStat.reflectdamage;
- petbasedamage = petStat.basedamage;
- petnaturedamage = petStat.naturedamage;
- petheal = petStat.heal;
- petbuffCnt = petStat.buffCnt;
- petaddSp = petStat.addSp;
- }
- friend.petdamage = petreflectdamage + petbasedamage + petnaturedamage;
- friend.damage = friend.reflectdamage + friend.basedamage + friend.naturedamage;
- friend.damagePercent = totalDamage > 0 ? (friend.damage + friend.petdamage) / totalDamage : 0;
- friend.hurtPercent = totalHurt > 0 ? (friend.hurt + pethurt) / totalHurt : 0;
- friend.heroDamagePercent = totalDamage > 0 ? friend.damage / totalDamage : 0;
- friend.heroHurtPercent = totalHurt > 0 ? friend.hurt / totalHurt : 0;
- float percent1 = totalHeal > 0 ? (friend.heal + petheal) / totalHeal : avgPercent;
- float percent2 = totalBuffCnt > 0 ? (friend.buffCnt + petbuffCnt) / totalBuffCnt : avgPercent;
- float percent3 = totalSp > 0 ? (friend.addSp + petaddSp) / totalSp : avgPercent;
- friend.healPercent = factorA * percent1 + factorB * percent2 + factorC * percent3;
- float percent4 = totalHeal > 0 ? friend.heal / totalHeal : avgPercent;
- float percent5 = totalBuffCnt > 0 ? friend.buffCnt / totalBuffCnt : avgPercent;
- float percent6 = totalSp > 0 ? friend.addSp / totalSp : avgPercent;
- friend.heroHealPercent = factorA * percent4 + factorB * percent5 + factorC * percent6;
- }
- else
- {
- friend.petdamage = 0;
- friend.damage = friend.reflectdamage + friend.basedamage + friend.naturedamage;
- friend.damagePercent = totalDamage > 0 ? friend.damage / totalDamage : 0;
- friend.hurtPercent = totalHurt > 0 ? friend.hurt / totalHurt : 0;
- friend.heroDamagePercent = friend.damagePercent;
- friend.heroHurtPercent = friend.hurtPercent;
- float percent1 = totalHeal > 0 ? friend.heal / totalHeal : avgPercent;
- float percent2 = totalBuffCnt > 0 ? friend.buffCnt / totalBuffCnt : avgPercent;
- float percent3 = totalSp > 0 ? friend.addSp / totalSp : avgPercent;
- friend.healPercent = factorA * percent1 + factorB * percent2 + factorC * percent3;
- friend.heroHealPercent = friend.healPercent;
- }
- if (friend.Dirty)
- {
- notify = true;
- friend.Dirty = false;
- }
- }
- }
- //自身输出比例设置
- int nMaxDamge = 0;
- if (null != mEnemyStatistics)
- {
- for (int idx = 0; idx < mEnemyStatistics.Count; idx++)
- {
- var enemy = mEnemyStatistics[idx];
- if (null == enemy)
- continue;
- nMaxDamge = Math.Max(nMaxDamge, enemy.basedamage + enemy.reflectdamage);
- nMaxDamge = Math.Max(nMaxDamge, enemy.naturedamage);
- nMaxDamge = Math.Max(nMaxDamge, enemy.petdamage);
- }
- for (int idx = 0; idx < mEnemyStatistics.Count; idx++)
- {
- var enemy = mEnemyStatistics[idx];
- if (null == enemy)
- continue;
- enemy.basedamagePercent = nMaxDamge > 0 ? ((float)(enemy.basedamage + enemy.reflectdamage) / nMaxDamge) : nMaxDamge;
- enemy.naturedamagePercent = nMaxDamge > 0 ? ((float)(enemy.naturedamage) / nMaxDamge) : nMaxDamge;
- enemy.petdamagePercent = nMaxDamge > 0 ? ((float)(enemy.petdamage) / nMaxDamge) : nMaxDamge;
- }
- }
-
- if (null != mFriendStatistics)
- {
- nMaxDamge = 0;
- for (int idx = 0; idx < mFriendStatistics.Count; idx++)
- {
- var friend = mFriendStatistics[idx];
- if (null == friend)
- continue;
- nMaxDamge = Math.Max(nMaxDamge, friend.basedamage + friend.reflectdamage);
- nMaxDamge = Math.Max(nMaxDamge, friend.naturedamage);
- nMaxDamge = Math.Max(nMaxDamge, friend.petdamage);
- }
-
- for (int idx = 0; idx < mFriendStatistics.Count; idx++)
- {
- var friend = mFriendStatistics[idx];
- if (null == friend)
- continue;
- friend.basedamagePercent = nMaxDamge > 0 ? ((float)(friend.basedamage+ friend.reflectdamage) / nMaxDamge) : nMaxDamge;
- friend.naturedamagePercent = nMaxDamge > 0 ? ((float)(friend.naturedamage) / nMaxDamge) : nMaxDamge;
- friend.petdamagePercent = nMaxDamge > 0 ? ((float)(friend.petdamage) / nMaxDamge) : nMaxDamge;
- }
- }
- if (notify)
- {
- BattleMgr.Instance.RefreshStatistics();
- }
- }
- private FighterStatistics GetPetStatistics(long petId, eTeamType teamType)
- {
- if(teamType == eTeamType.Friend)
- {
- if (mFriendPetStatistics == null) return null;
-
- for(int idx =0; idx < mFriendPetStatistics.Count;idx++)
- {
- if (mFriendPetStatistics[idx].fighterId == petId)
- return mFriendPetStatistics[idx];
- }
- }
- else
- {
- if (mEnemyPetStatistics == null) return null;
- for(int idx =0; idx < mEnemyPetStatistics.Count;idx++)
- {
- if (mEnemyPetStatistics[idx].fighterId == petId)
- return mEnemyPetStatistics[idx];
- }
- }
- return null;
- }
- }
|