Add StickGame Assets

This commit is contained in:
Dzejkobik007
2024-03-24 22:21:16 +01:00
parent 5a5812c0c7
commit 6c8b523d1f
6643 changed files with 596260 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using FishNet.Connection;
using FishNet.Observing;
using UnityEngine;
namespace FishNet.Component.Observing
{
[CreateAssetMenu(menuName = "FishNet/Observers/Host Only Condition", fileName = "New Host Only Condition")]
public class HostOnlyCondition : ObserverCondition
{
public override bool ConditionMet(NetworkConnection connection, bool currentlyAdded, out bool notProcessed)
{
notProcessed = false;
/* Only return true if connection is the local client.
* This check only runs on the server, so if local client
* is true then they must also be the server (clientHost). */
return (base.NetworkObject.ClientManager.Connection == connection);
}
/// <summary>
/// How a condition is handled.
/// </summary>
/// <returns></returns>
public override ObserverConditionType GetConditionType() => ObserverConditionType.Normal;
public override ObserverCondition Clone()
{
HostOnlyCondition copy = ScriptableObject.CreateInstance<HostOnlyCondition>();
return copy;
}
}
}