vrchat-community / UdonSharp

A compiler for compiling C# to Udon assembly
https://udonsharp.docs.vrchat.com
MIT License
463 stars 50 forks source link

RequestSerialization should be virtual #34

Closed FairlySadPanda closed 2 years ago

FairlySadPanda commented 2 years ago

RequestSerialization is technically a built-in, but there's no reason to prevent extension by developers (or warn against it, depending on the IDE).

An example of this usecase is the common pattern of calling RequestSerialization() and then OnDeserialization(). By extending RequestSerialization we can declare that we always will call OnDeserialization afterwards, reducing boilerplate.

Other examples: if we would like to update an atomic clock by one whenever we call RequestSerialization, or we might want to automate assigning ownership.

github-actions[bot] commented 2 years ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

FairlySadPanda commented 2 years ago

I have read the CLA Document and I hereby sign the CLA

FairlySadPanda commented 2 years ago

Closing to be a bit neater with my own fork.