示例#1
0
 public static void AddVectorMappings(this ServerBuilder builder)
 {
     builder.AddStructLuaMapping <Vector2>(x => new Dictionary <LuaValue, LuaValue>()
     {
         ["X"] = x.X,
         ["Y"] = x.Y,
     });
     builder.AddStructLuaMapping <Vector3>(x => new Dictionary <LuaValue, LuaValue>()
     {
         ["X"] = x.X,
         ["Y"] = x.Y,
         ["Z"] = x.Z,
     });
     builder.AddStructLuaMapping <Vector4>(x => new Dictionary <LuaValue, LuaValue>()
     {
         ["X"] = x.X,
         ["Y"] = x.Y,
         ["Z"] = x.Z,
         ["W"] = x.W,
     });
 }