You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs
+88-7Lines changed: 88 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -512,22 +512,27 @@ public enum OwnershipStatus
512
512
/// When set, this instance will have no permissions (i.e. cannot distribute, transfer, etc).
513
513
/// </summary>
514
514
None=0,
515
+
515
516
/// <summary>
516
517
/// When set, this instance will be automatically redistributed when a client joins (if not locked or no request is pending) or leaves.
517
518
/// </summary>
518
519
Distributable=1<<0,
520
+
519
521
/// <summary>
520
522
/// When set, a non-owner can obtain ownership immediately (without requesting and as long as it is not locked).
521
523
/// </summary>
522
524
Transferable=1<<1,
525
+
523
526
/// <summary>
524
527
/// When set, a non-owner must request ownership from the owner (will always get locked once ownership is transferred).
525
528
/// </summary>
526
529
RequestRequired=1<<2,
530
+
527
531
/// <summary>
528
532
/// When set, only the current session owner may have ownership over this object.
529
533
/// </summary>
530
534
SessionOwner=1<<3,
535
+
531
536
/// <summary>
532
537
/// Used within the inspector view only. When selected it will set the Distributable, Transferable, and RequestRequired flags or if those flags are already set it will select the SessionOwner flag by itself.
533
538
/// </summary>
@@ -627,10 +632,29 @@ public bool SetOwnershipLock(bool lockOwnership = true)
627
632
/// </summary>
628
633
publicenumOwnershipPermissionsFailureStatus
629
634
{
635
+
/// <summary>
636
+
/// The NetworkObject is locked and ownership cannot be acquired
637
+
/// </summary>
630
638
Locked,
639
+
640
+
/// <summary>
641
+
/// The NetworkObject requires an ownership request via RequestOwnership
642
+
/// </summary>
631
643
RequestRequired,
644
+
645
+
/// <summary>
646
+
/// The NetworkObject is already processing an ownership request and ownership cannot be acquired at this time
647
+
/// </summary>
632
648
RequestInProgress,
649
+
650
+
/// <summary>
651
+
/// The NetworkObject does not have the OwnershipStatus.Transferable flag set and ownership cannot be acquired
652
+
/// </summary>
633
653
NotTransferrable,
654
+
655
+
/// <summary>
656
+
/// The NetworkObject has the OwnershipStatus.SessionOwner flag set and ownership cannot be acquired
657
+
/// </summary>
634
658
SessionOwnerOnly
635
659
}
636
660
@@ -658,11 +682,35 @@ public enum OwnershipPermissionsFailureStatus
658
682
/// </summary>
659
683
publicenumOwnershipRequestStatus
660
684
{
685
+
/// <summary>
686
+
/// The request for ownership was sent (does not mean it will be granted, but the request was sent)
687
+
/// </summary>
661
688
RequestSent,
689
+
690
+
/// <summary>
691
+
/// The current client is already the owner (no need to request ownership)
692
+
/// </summary>
662
693
AlreadyOwner,
694
+
695
+
/// <summary>
696
+
/// The OwnershipStatus.RequestRequired flag is not set on this NetworkObject
697
+
/// </summary>
663
698
RequestRequiredNotSet,
699
+
700
+
/// <summary>
701
+
/// The current owner has locked ownership which means requests are not available at this time
702
+
/// </summary
664
703
Locked,
704
+
705
+
/// <summary>
706
+
/// There is already a known request in progress. You can scan for ownership changes and try again
707
+
/// after a specific period of time or no longer attempt to request ownership
708
+
/// </summary>
665
709
RequestInProgress,
710
+
711
+
/// <summary>
712
+
/// This object is marked as SessionOwnerOnly and therefore cannot be requested
0 commit comments