From 4590a25e0e9d6161abe5a4b7134df012d3f2e5fd Mon Sep 17 00:00:00 2001 From: vis2k Date: Mon, 27 Sep 2021 15:24:10 +0800 Subject: [PATCH] OnDirty simplified now that it's a class with a default implementation --- Assets/Mirror/Runtime/SyncObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Mirror/Runtime/SyncObject.cs b/Assets/Mirror/Runtime/SyncObject.cs index 9edab8570..dc7c5ca70 100644 --- a/Assets/Mirror/Runtime/SyncObject.cs +++ b/Assets/Mirror/Runtime/SyncObject.cs @@ -20,7 +20,7 @@ public abstract class SyncObject // => Weaver calls InitSyncObject and replaces it // => if it was not replaced, then it was a runtime change which is not allowed. // ===> this way we can show SyncVar in the Inspector! - public virtual Action OnDirty { get; set; } = () => + public Action OnDirty = () => throw new Exception("SyncObject was not initialized. Do not create 'new SyncObject's at runtime. Define them once, then Weaver will initialize them."); /// Used internally to check if we are currently tracking changes.