LethalCompany/Lethal Company/ExportedProject/Assets/Scripts/Assembly-CSharp/SyncWithServerOnSpawn.cs

38 lines
636 B
C#
Raw Normal View History

2023-12-22 22:51:17 +00:00
using Unity.Netcode;
using UnityEngine;
public class SyncWithServerOnSpawn : NetworkBehaviour
{
public RoundManager roundManager;
private bool hasSynced;
private void Start()
{
}
public void SyncWithServer()
{
if (!base.IsServer)
{
Object.Destroy(base.gameObject);
return;
}
NetworkObject component = base.gameObject.GetComponent<NetworkObject>();
if (component != null)
{
component.Spawn(destroyWithScene: true);
}
}
protected override void __initializeVariables()
{
base.__initializeVariables();
}
protected internal override string __getTypeName()
{
return "SyncWithServerOnSpawn";
}
}