From c788b76f0b9e5cdcae6efe0cf037545c0f34f5d6 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 19 Aug 2023 15:02:45 +0900 Subject: [PATCH 1/2] fix: Network IDs us not assigned for newly created PBs --- Editor/PreventRemoveAvatarEditorOnly.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Editor/PreventRemoveAvatarEditorOnly.cs b/Editor/PreventRemoveAvatarEditorOnly.cs index 6890ba2f3..7e751b68f 100644 --- a/Editor/PreventRemoveAvatarEditorOnly.cs +++ b/Editor/PreventRemoveAvatarEditorOnly.cs @@ -4,6 +4,7 @@ using UnityEngine; using VRC.SDKBase; using VRC.SDKBase.Editor.BuildPipeline; +using VRC.SDKBase.Network; using Debug = System.Diagnostics.Debug; namespace Anatawa12.AvatarOptimizer @@ -54,4 +55,15 @@ public bool OnPreprocessAvatar(GameObject avatarGameObject) return true; } } + + internal class AaoReassignNetworkId : IVRCSDKPreprocessAvatarCallback + { + public int callbackOrder => 65536; + + public bool OnPreprocessAvatar(GameObject avatarGameObject) + { + NetworkIDAssignment.ConfigureNetworkIDs(avatarGameObject.GetComponent()); + return true; + } + } } From dfefd00130cc6f39381978ec5612d809950724fc Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 19 Aug 2023 15:05:12 +0900 Subject: [PATCH 2/2] docs(changelog): add Network ID is not assigned for newly created PBs --- CHANGELOG-PRERELEASE.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index f88a5de48..1b9e16f0c 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog]. ### Fixed - Unity Editor may freezes when there are circular dependency `#329` +- Network ID is not assigned for newly created PBs `#331` ### Security diff --git a/CHANGELOG.md b/CHANGELOG.md index 37383bb75..c8ad566a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog]. ### Fixed - Unity Editor may freezes when there are circular dependency `#329` +- Network ID is not assigned for newly created PBs `#331` ### Security