Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #54 from yunspace/master
Browse files Browse the repository at this point in the history
Added instructions for Unity Unit Tests
  • Loading branch information
neuecc authored Jan 24, 2017
2 parents b74b580 + 786e7f5 commit edc1930
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,16 @@ zfc.exe -i "..\src\Sandbox.Shared.csproj" -s -o "..\unity\ZfcCompiled\"
Generated formatters must need to register on Startup. By default, zfc generate automatic register code on `RuntimeInitializeOnLoad` timing.

For Unity Unit Tests, the generated formatters must be registered in the `SetUp` method:

```csharp
[SetUp]
public void RegisterZeroFormatter()
{
ZeroFormatterInitializer.Register();
}
```

ZeroFormatter can not serialize Unity native types by default but you can make custom formatter by define pseudo type. For example create `Vector2` to ZeroFormatter target.

```csharp
Expand Down

0 comments on commit edc1930

Please sign in to comment.