mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00: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>
|
/// <summary>
|
||||||
/// True if this object only exists on the server
|
/// True if this object only exists on the server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool isServerOnly => isServer && !isClient;
|
public bool isServerOnly => netIdentity.isServerOnly;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// True if this object exists on a client that is not also acting as a server
|
/// True if this object exists on a client that is not also acting as a server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool isClientOnly => isClient && !isServer;
|
public bool isClientOnly => netIdentity.isClientOnly;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This returns true if this object is the authoritative version of the object in the distributed network application.
|
/// 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>
|
/// </summary>
|
||||||
public bool isLocalPlayer => ClientScene.localPlayer == this;
|
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>
|
/// <summary>
|
||||||
/// This returns true if this object is the authoritative player object on the client.
|
/// 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>
|
/// <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