Skip to content

Commit

Permalink
Merge pull request #331 from anatawa12/reassign-network-id-later
Browse files Browse the repository at this point in the history
fix: Network IDs us not assigned for newly created PBs
  • Loading branch information
anatawa12 authored Aug 19, 2023
2 parents 3cb2c1c + dfefd00 commit fefcc61
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions Editor/PreventRemoveAvatarEditorOnly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<VRC_AvatarDescriptor>());
return true;
}
}
}

0 comments on commit fefcc61

Please sign in to comment.