mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
feat: NetworkIdentity.isServer/ClientOnly added. NetworkBehaviour.isServer/ClientOnly uses it.
This commit is contained in:
parent
4bef7fc635
commit
239bc660fd
@ -60,12 +60,12 @@ public abstract class NetworkBehaviour : MonoBehaviour
|
||||
/// <summary>
|
||||
/// True if this object only exists on the server
|
||||
/// </summary>
|
||||
public bool isServerOnly => isServer && !isClient;
|
||||
public bool isServerOnly => netIdentity.isServerOnly;
|
||||
|
||||
/// <summary>
|
||||
/// True if this object exists on a client that is not also acting as a server
|
||||
/// </summary>
|
||||
public bool isClientOnly => isClient && !isServer;
|
||||
public bool isClientOnly => netIdentity.isClientOnly;
|
||||
|
||||
/// <summary>
|
||||
/// This returns true if this object is the authoritative version of the object in the distributed network application.
|
||||
|
@ -162,6 +162,16 @@ public sealed class NetworkIdentity : MonoBehaviour
|
||||
/// </summary>
|
||||
public bool isLocalPlayer => ClientScene.localPlayer == this;
|
||||
|
||||
/// <summary>
|
||||
/// True if this object only exists on the server
|
||||
/// </summary>
|
||||
public bool isServerOnly => isServer && !isClient;
|
||||
|
||||
/// <summary>
|
||||
/// True if this object exists on a client that is not also acting as a server
|
||||
/// </summary>
|
||||
public bool isClientOnly => isClient && !isServer;
|
||||
|
||||
/// <summary>
|
||||
/// This returns true if this object is the authoritative player object on the client.
|
||||
/// <para>This value is determined at runtime. For most objects, authority is held by the server.</para>
|
||||
|
Loading…
Reference in New Issue
Block a user