This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
station_obscurum_unity/Assets/FishNet/Runtime/Utility/Extension/Object.cs

27 lines
809 B
C#
Raw Normal View History

2023-05-31 17:32:21 +02:00
using FishNet.Connection;
using FishNet.Object;
using System.Runtime.CompilerServices;
using UnityEngine;
namespace FishNet.Utility.Extension
{
public static class ObjectFN
{
/// <summary>
/// Spawns an object over the network using InstanceFinder. Only call from the server.
/// </summary>
public static void Spawn(this NetworkObject nob, NetworkConnection owner = null)
{
InstanceFinder.ServerManager.Spawn(nob, owner);
}
/// <summary>
/// Spawns an object over the network using InstanceFinder. Only call from the server.
/// </summary>
public static void Spawn(this GameObject go, NetworkConnection owner = null)
{
InstanceFinder.ServerManager.Spawn(go, owner);
}
}
}