Mirror/doc/Articles/Guides/BestPractices.md
James Frowen b86a611674
Restructure docs (#2249)
* moving all guides to Articles folder

* updating toc for root and articles

* fixing toc

* css on side toc

* fixing links on index
2020-09-16 22:27:05 +01:00

451 B

Best Practices

work in progress

Custom Messages

If you send custom message regularly then the message should be a struct so that there is no GC/allocations

struct CreateVisualEffect : IMessageBase
{
    public Vector3 position;
    public Guid prefabId;

    // Mirror will automatically implement message that are empty
    public void Deserialize(NetworkReader reader) { }
    public void Serialize(NetworkWriter writer) { }
}