标签:pre get war div 处理 public init add osi
public class WardEntity : PositiveEntity
{
public static WardEntity GetWard(Vec3 aPos, int aTeamID, LFixed aLifeTime) { WardEntity entity; entity = CreateEntity(aTeamID); entity.CanSelected = true; entity.LogicTrans.position = aPos; //entity.InitWardEntity(aPos); entity.TeamId = aTeamID; entity.ForceUpdateShowLvl = true; entity.mMaxLifeTime = aLifeTime; entity.LifeTime = aLifeTime; //entity.SetUpdate(true); entity.Start(); EntityManager.Instance.Add(entity.EntityId, entity); return entity; }
}
好处是,在外部可以直接使用WardEntity.GetWard(pos, id, life)来获取一个对象。直观,好用。
传统引擎的处理是这样的 var ward = EntityManager.GetWard(); ward.Init(pos, id, life),好好对比下这两个点
标签:pre get war div 处理 public init add osi
原文地址:https://www.cnblogs.com/timeObjserver/p/10482353.html