示例#1
0
 public static Offset <Vector3Partial> ToFlatBufferPartial(this System.Numerics.Vector3 vector, FlatBufferBuilder builder)
 {
     Vector3Partial.StartVector3Partial(builder);
     Vector3Partial.AddX(builder, Float.CreateFloat(builder, vector.X));
     Vector3Partial.AddY(builder, Float.CreateFloat(builder, vector.Y));
     Vector3Partial.AddZ(builder, Float.CreateFloat(builder, vector.Z));
     return(Vector3Partial.EndVector3Partial(builder));
 }
示例#2
0
        public Offset <Vector3Partial> ToFlatBuffer(FlatBufferBuilder builder)
        {
            Vector3Partial.StartVector3Partial(builder);

            if (X.HasValue)
            {
                Vector3Partial.AddX(builder, Float.CreateFloat(builder, X.Value));
            }

            if (Y.HasValue)
            {
                Vector3Partial.AddY(builder, Float.CreateFloat(builder, Y.Value));
            }

            if (Z.HasValue)
            {
                Vector3Partial.AddZ(builder, Float.CreateFloat(builder, Z.Value));
            }

            return(Vector3Partial.EndVector3Partial(builder));
        }