mirror of
https://github.com/Dadechin/Unity-WebSocket.git
synced 2025-07-03 20:04:33 +00:00
25 lines
1.1 KiB
C#
25 lines
1.1 KiB
C#
using FishNet.Documenting;
|
|
using FishNet.Managing;
|
|
using FishNet.Object;
|
|
|
|
namespace FishNet.Utility.Extension
|
|
{
|
|
[APIExclude]
|
|
public static class NetworksFN
|
|
{
|
|
/// <summary>
|
|
/// Returns if logic could have potentially called already on server side, and is calling a second time for clientHost side.
|
|
/// </summary>
|
|
public static bool DoubleLogic(this NetworkObject nob, bool asServer) => (!asServer && nob.NetworkManager.IsServerStarted);
|
|
/// <summary>
|
|
/// Returns if logic could have potentially called already on server side, and is calling a second time for clientHost side.
|
|
/// </summary>
|
|
public static bool DoubleLogic(this NetworkManager manager, bool asServer) => (!asServer && manager.IsServerStarted);
|
|
/// <summary>
|
|
/// Returns if logic could have potentially called already on server side, and is calling a second time for clientHost side.
|
|
/// </summary>
|
|
public static bool DoubleLogic(this NetworkBehaviour nb, bool asServer) => (!asServer && nb.NetworkManager.IsServerStarted);
|
|
|
|
}
|
|
|
|
} |