Exemple #1
0
    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);
        }
    }
Exemple #2
0
 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;
 }
Exemple #3
0
 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;
 }