-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: explicit declaration of network messages (#565)
Normally MirrorNG detects what is a message and creates an id and serializer for it. This PR allows you to explicitly declare a class or struct as a network message This can be useful when you are making a generic class (such as Discovery) to explicitly mark a class/struct as a network message you can do: ```cs [NetworkMessage] public struct MyMessage { ... } ```
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
Assets/Tests/Weaver/GeneratedReaderWriterTests~/CreateForExplicitNetworkMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Mirror; | ||
|
||
namespace GeneratedReaderWriterTests.CreateForExplicitNetworkMessage | ||
{ | ||
[NetworkMessage] | ||
public class SomeOtherData | ||
{ | ||
public int usefulNumber; | ||
} | ||
} |