void SerializeProto(Game.EntityPrototype proto) { var json = Newtonsoft.Json.JsonConvert.SerializeObject(proto, Newtonsoft.Json.Formatting.Indented); using (var writer = new System.IO.StreamWriter(System.IO.Path.Combine("Units", proto.name + ".json"))) { writer.Write(json); } }
public Entity(int team, DVector3 position, EntityPrototype prototype) { this.eid = World.current.RegisterEntity(this); this.team = team; this.position = position; this.isAlive = true; this.prototype = prototype; this.modelName = prototype.name; }
public Entity(int team, DVector3 position, string modelName) { this.eid = World.current.RegisterEntity(this); this.team = team; this.position = position; this.modelName = modelName; this.isAlive = true; this.prototype = null; }