You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
731 B
35 lines
731 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
using ProtoCSClass;
|
|
#if UNITY_2019_1_OR_NEWER
|
|
using ILLitJson;
|
|
#else
|
|
using LitJson;
|
|
#endif
|
|
using Sog;
|
|
|
|
namespace Battle
|
|
{
|
|
internal static class BattleObjExt
|
|
{
|
|
public static BattleHero GetHeroByObjId(this BattleObj battle, uint objId, bool isAlive)
|
|
{
|
|
foreach (BattleHero creat in battle.allCreatures)
|
|
{
|
|
if (creat.objId == objId)
|
|
{
|
|
if (! isAlive)
|
|
{
|
|
return creat;
|
|
}
|
|
|
|
return creat.isDead ? null : creat;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|