Skip to content

Commit 393a1e4

Browse files
Merge pull request #967 from Jazz23/feature/implicit-operator
Add implicit operator to NetworkBehavior
2 parents c8fab06 + 98dbffc commit 393a1e4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Assets/FishNet/Runtime/Object/NetworkBehaviour/NetworkBehaviour.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public byte ComponentIndex
6060
/// NetworkObject this behaviour is for.
6161
/// </summary>
6262
public NetworkObject NetworkObject => _networkObjectCache;
63+
public static implicit operator NetworkObject(NetworkBehaviour nb) => nb._networkObjectCache;
6364
#endregion
6465

6566
#region Private.

0 commit comments

Comments
 (0)