public override MomentComponentBase DeepCopy() { TestLifeSpanComponent lsc = new TestLifeSpanComponent(); lsc.lifeTime = lifeTime; return(lsc); }
public override void FixedUpdate(int deltaTime) { List <EntityBase> list = GetEntityList(); for (int i = 0; i < list.Count; i++) { TestLifeSpanComponent lsc = list[i].GetComp <TestLifeSpanComponent>(); lsc.lifeTime -= deltaTime; //Debug.Log("lsc.lifeTime " + lsc.lifeTime + " frame " + m_world.FrameCount + " ID " + lsc.Entity.ID); if (lsc.lifeTime <= 0) { m_world.ClientDestroyEntity(list[i].ID); } } }
public override void FixedUpdate(int deltaTime) { List <EntityBase> list = GetEntityList(); for (int i = 0; i < list.Count; i++) { TestCommandComponent cc = list[i].GetComp <TestCommandComponent>(); if (cc.isFire) { //Debug.Log("Fire " + m_world.FrameCount); TestLifeSpanComponent lsc = new TestLifeSpanComponent(); lsc.lifeTime = 500; m_world.CreateEntity("FireObject" + cc.Entity.ID, lsc); } } }