public SimUnitInstance(Simulation sim, SimUnitConfig unit, Vector3 startpos, ISimUnitEventHandler handler) : base(sim, unit, startpos) { Health = unit.Health; UnitConfig = unit; eventhandler = handler; this.OnDestroy += handler.OnDestroyEventHandler; }
public SimUnitInstance AddUnit(SimUnitConfig unittype, Vector3 startingposition, ISimUnitEventHandler EventHandler) { SimUnitInstance inst = new SimUnitInstance(this, unittype, startingposition, EventHandler); if (unittype.Team == SimUnitConfig.ETeam.Friendly) { FriendlySimUnits.Add(inst); } else { EnemySimUnits.Add(inst); } return(inst); }