Skip to content

Commit d22a42c

Browse files
RequestSerialization should be virtual
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.
1 parent 86b9139 commit d22a42c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Packages/com.vrchat.UdonSharp/Runtime/UdonSharpBehaviour.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ protected static GameObject VRCInstantiate(GameObject original)
145145
/// <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>
146146
/// </summary>
147147
[PublicAPI]
148-
public void RequestSerialization() { }
148+
public virtual void RequestSerialization() { }
149149

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

0 commit comments

Comments
 (0)