Skip to content

Commit

Permalink
RequestSerialization should be virtual
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
FairlySadPanda committed May 31, 2022
1 parent 86b9139 commit d22a42c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ protected static GameObject VRCInstantiate(GameObject original)
/// <remarks>This will only function if the UdonSharpBehaviour is set to Manual sync mode and the person calling RequestSerialization() is the owner of the object.</remarks>
/// </summary>
[PublicAPI]
public void RequestSerialization() { }
public virtual void RequestSerialization() { }

// Stubs for builtin UdonSharp methods to get type info
private static long GetUdonTypeID(System.Type type)
Expand Down

0 comments on commit d22a42c

Please sign in to comment.