public void Clear() { id = 0; //唯一ID profession = 0; //英雄职业 1 英雄 2 炮 name = ""; //头顶名字 camp = HeroCamp.Attack; //阵营 IID = 0; //表的ID x = 0; y = 0; z = 0; rotation = 0; scale = 1; speed = 0; target = 0; lastTarget = 0;//上一个目标 config = ""; ai = ""; height = 0;//模型高度 searchDistance = 0; attackDistance = 0; hp = 0; maxhp = 0; attack = 0; defense = 0; destination = Vector3.zero; stopDistance = DEFAULT_STOPDISTANCE; }
public int GetEntityCount(HeroCamp camp) { int count = 0; for (int i = entities.Count - 1; i >= 0; --i) { var entity = entities[i]; if (entity != null && entity.data.camp == camp) { count++; } } return(count); }