23 lines
520 B
C#
23 lines
520 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace BITKit.Entities
|
|
{
|
|
public sealed class EntityNetConfig : EntityBehavior
|
|
{
|
|
[SerializeField] private bool serverOnly;
|
|
[SerializeReference,SubclassSelector] private INetClient netClient;
|
|
[SerializeReference,SubclassSelector] private INetServer netServer;
|
|
public override void OnUpdate(float deltaTime)
|
|
{
|
|
base.OnUpdate(deltaTime);
|
|
if (netClient.IsConnected && serverOnly)
|
|
{
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|