Added null checks to NetworkedObject
This commit is contained in:
parent
5beac0f00c
commit
f258f0bb68
@ -124,6 +124,7 @@ namespace MLAPI.MonoBehaviours.Core
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (NetworkingManager.singleton != null)
|
||||
SpawnManager.OnDestroyObject(NetworkId, false);
|
||||
}
|
||||
|
||||
@ -132,6 +133,7 @@ namespace MLAPI.MonoBehaviours.Core
|
||||
/// </summary>
|
||||
public void Spawn()
|
||||
{
|
||||
if (NetworkingManager.singleton != null)
|
||||
SpawnManager.OnSpawnObject(this);
|
||||
}
|
||||
/// <summary>
|
||||
@ -140,6 +142,7 @@ namespace MLAPI.MonoBehaviours.Core
|
||||
/// <param name="clientId">The clientId to own the object</param>
|
||||
public void SpawnWithOwnership(int clientId)
|
||||
{
|
||||
if (NetworkingManager.singleton != null)
|
||||
SpawnManager.OnSpawnObject(this, clientId);
|
||||
}
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user