com.kagekirin.unitymathematics.schemas.amalgamate
Version:
FlatBuffer schemas for Unity.Mathematics types This package also contains the following dependency assemblies:* FlatSharp.Runtime@7.8.0 * UnityMathematics.NoDeps@1.3.2
70 lines (52 loc) • 2.28 kB
Markdown
Thanks for using FlatSharp! FlatSharp is a C
- [FlatSharp Samples](https://github.com/jamescourtney/FlatSharp/tree/main/samples)
- [FlatSharp Wiki](https://github.com/jamescourtney/FlatSharp/wiki)
- [FlatBuffers Overview](https://google.github.io/flatbuffers/index.html#flatbuffers_overview)
- [FlatBuffers Schema Authoring](https://google.github.io/flatbuffers/flatbuffers_guide_writing_schema.html)
FlatSharp is open source. Find it on [GitHub](https://github.com/jamescourtney/FlatSharp)! Issues, contributions, and other feedback are always welcome. Don't be a stranger! If you have feedback to share, please consider filling out the form [here](https://forms.office.com/r/sHkumrr6sK)!
FlatSharp is free and always will be. However, the project does take a significant amount of time to maintain. If you or your organization find the project useful, please consider a [Github sponsorship](https://github.com/sponsors/jamescourtney). Any amount is appreciated!
Reference both `FlatSharp.Runtime` and `FlatSharp.Compiler`. Use the same version for them both.
```idl
// all FlatSharp FBS attributes start with the 'fs_' prefix.
attribute "fs_serializer";
namespace MyNamespace;
enum Color : ubyte { Red = 1, Green, Blue }
table Person (fs_serializer) {
Id:int;
Name:string;
Parent:Person (deprecated);
Children:[Person];
FavoriteColor:Color = Blue;
Position:Location;
}
struct Location {
Latitude:float;
Longitude:float;
}
```
```xml
<ItemGroup>
<FlatSharpSchema Include="YourSchema.fbs" />
</ItemGroup>
```
```c
Person person = new Person(...);
int maxBytesNeeded = Person.Serializer.GetMaxSize(person);
byte[] buffer = new byte[maxBytesNeeded];
int bytesWritten = Person.Serializer.Serialize(buffer, person);
```
```c
Person p = Person.Serializer.Parse(data);
```
FlatSharp is licensed under Apache 2.0. Have fun :)