mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
b86a611674
* moving all guides to Articles folder * updating toc for root and articles * fixing toc * css on side toc * fixing links on index
21 lines
451 B
Markdown
21 lines
451 B
Markdown
# 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
|
|
|
|
```cs
|
|
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) { }
|
|
}
|
|
```
|