1 // <auto-generated>
2 //  automatically generated by the FlatBuffers compiler, do not modify
3 // </auto-generated>
4 
5 namespace MyGame.Example
6 {
7 
8 using global::System;
9 using global::System.Collections.Generic;
10 using global::FlatBuffers;
11 
12 public struct Vec3 : IFlatbufferObject
13 {
14   private Struct __p;
15   public ByteBuffer ByteBuffer { get { return __p.bb; } }
__initMyGame.Example.Vec316   public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
__assignMyGame.Example.Vec317   public Vec3 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
18 
19   public float X { get { return __p.bb.GetFloat(__p.bb_pos + 0); } }
MutateXMyGame.Example.Vec320   public void MutateX(float x) { __p.bb.PutFloat(__p.bb_pos + 0, x); }
21   public float Y { get { return __p.bb.GetFloat(__p.bb_pos + 4); } }
MutateYMyGame.Example.Vec322   public void MutateY(float y) { __p.bb.PutFloat(__p.bb_pos + 4, y); }
23   public float Z { get { return __p.bb.GetFloat(__p.bb_pos + 8); } }
MutateZMyGame.Example.Vec324   public void MutateZ(float z) { __p.bb.PutFloat(__p.bb_pos + 8, z); }
25   public double Test1 { get { return __p.bb.GetDouble(__p.bb_pos + 16); } }
MutateTest1MyGame.Example.Vec326   public void MutateTest1(double test1) { __p.bb.PutDouble(__p.bb_pos + 16, test1); }
27   public MyGame.Example.Color Test2 { get { return (MyGame.Example.Color)__p.bb.Get(__p.bb_pos + 24); } }
MutateTest2MyGame.Example.Vec328   public void MutateTest2(MyGame.Example.Color test2) { __p.bb.Put(__p.bb_pos + 24, (byte)test2); }
29   public MyGame.Example.Test Test3 { get { return (new MyGame.Example.Test()).__assign(__p.bb_pos + 26, __p.bb); } }
30 
CreateVec3MyGame.Example.Vec331   public static Offset<MyGame.Example.Vec3> CreateVec3(FlatBufferBuilder builder, float X, float Y, float Z, double Test1, MyGame.Example.Color Test2, short test3_A, sbyte test3_B) {
32     builder.Prep(8, 32);
33     builder.Pad(2);
34     builder.Prep(2, 4);
35     builder.Pad(1);
36     builder.PutSbyte(test3_B);
37     builder.PutShort(test3_A);
38     builder.Pad(1);
39     builder.PutByte((byte)Test2);
40     builder.PutDouble(Test1);
41     builder.Pad(4);
42     builder.PutFloat(Z);
43     builder.PutFloat(Y);
44     builder.PutFloat(X);
45     return new Offset<MyGame.Example.Vec3>(builder.Offset);
46   }
UnPackMyGame.Example.Vec347   public Vec3T UnPack() {
48     var _o = new Vec3T();
49     this.UnPackTo(_o);
50     return _o;
51   }
UnPackToMyGame.Example.Vec352   public void UnPackTo(Vec3T _o) {
53     _o.X = this.X;
54     _o.Y = this.Y;
55     _o.Z = this.Z;
56     _o.Test1 = this.Test1;
57     _o.Test2 = this.Test2;
58     _o.Test3 = this.Test3.UnPack();
59   }
PackMyGame.Example.Vec360   public static Offset<MyGame.Example.Vec3> Pack(FlatBufferBuilder builder, Vec3T _o) {
61     if (_o == null) return default(Offset<MyGame.Example.Vec3>);
62     return CreateVec3(
63       builder,
64       _o.X,
65       _o.Y,
66       _o.Z,
67       _o.Test1,
68       _o.Test2,
69       _o.Test3.A,
70       _o.Test3.B);
71   }
72 };
73 
74 public class Vec3T
75 {
76   [Newtonsoft.Json.JsonProperty("x")]
77   public float X { get; set; }
78   [Newtonsoft.Json.JsonProperty("y")]
79   public float Y { get; set; }
80   [Newtonsoft.Json.JsonProperty("z")]
81   public float Z { get; set; }
82   [Newtonsoft.Json.JsonProperty("test1")]
83   public double Test1 { get; set; }
84   [Newtonsoft.Json.JsonProperty("test2")]
85   public MyGame.Example.Color Test2 { get; set; }
86   [Newtonsoft.Json.JsonProperty("test3")]
87   public MyGame.Example.TestT Test3 { get; set; }
88 
Vec3T()89   public Vec3T() {
90     this.X = 0.0f;
91     this.Y = 0.0f;
92     this.Z = 0.0f;
93     this.Test1 = 0.0;
94     this.Test2 = 0;
95     this.Test3 = new MyGame.Example.TestT();
96   }
97 }
98 
99 
100 }
101