Skip to content

Commit 5da3ff4

Browse files
fix: NetworkObject.GetNetworkBehaviourAtOrderIndex permission level (#3541)
This resolves a regression bug where NetworkObject.GetNetworkBehaviourAtOrderIndex was converted from public to internal during the original v2.0.0-pre branch creation. MTTB-1427 fix: #3528 <!-- Add short version of the JIRA ticket to the PR title (e.g. "feat: new shiny feature [MTT-123]") --> ## Changelog - Fixed: Regression issue in v2.x where `NetworkObject.GetNetworkBehaviourAtOrderIndex` was converted from public to internal. ## Testing and Documentation - No tests have been added. - No documentation changes or additions were necessary. <!-- Uncomment and mark items off with a * if this PR deprecates any API: ### Deprecated API - [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter yyyy-mm-dd)` entry. - [ ] An [api updater] was added. - [ ] Deprecation of the API is explained in the CHANGELOG. - [ ] The users can understand why this API was removed and what they should use instead. --> ## Backport This issue is specific to v2.x. <!-- If this is a backport: - Add the following to the PR title: "\[Backport\] ..." . - Link to the original PR. If this needs a backport - state this here If a backport is not needed please provide the reason why. If the "Backports" section is not present it will lead to a CI test failure. -->
1 parent dc58e42 commit 5da3ff4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1616

1717
### Fixed
1818

19+
- Fixed regression issue in v2.x where `NetworkObject.GetNetworkBehaviourAtOrderIndex` was converted from public to internal. (#3541)
1920
- Fixed ensuring OnValueChanged callback is still triggered on the authority when a collection changes and then reverts to the previous value in the same frame. (#3539)
2021
- Fixed synchronizing the destroyGameObject parameter to clients for InScenePlaced network objects. (#3514)
2122
- Fixed distributed authority related issue where enabling the `NetworkObject.DestroyWithScene` would cause errors when a destroying non-authority instances due to loading (single mode) or unloading scene events. (#3500)

com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,12 @@ public ushort GetNetworkBehaviourOrderIndex(NetworkBehaviour instance)
27622762
return 0;
27632763
}
27642764

2765-
internal NetworkBehaviour GetNetworkBehaviourAtOrderIndex(ushort index)
2765+
/// <summary>
2766+
/// Returns the <see cref="NetworkBehaviour"/> at the ordered index value which can be obtained using <see cref="GetNetworkBehaviourOrderIndex"/>.
2767+
/// </summary>
2768+
/// <param name="index">The order index value of the <see cref="NetworkBehaviour"/>.</param>
2769+
/// <returns>The <see cref="NetworkBehaviour"/> at the ordered index value or null if it does not exist.</returns>
2770+
public NetworkBehaviour GetNetworkBehaviourAtOrderIndex(ushort index)
27662771
{
27672772
if (index >= ChildNetworkBehaviours.Count)
27682773
{

0 commit comments

Comments
 (0)