Files
Learning-UnityNGO/Assets/CONTENT/FEATURES/DEV-TEST/Scripts/GameBootstrapper.cs
T
2026-06-17 20:44:53 +03:00

16 lines
385 B
C#

using Unity.Netcode;
using UnityEngine;
public class GameBootstrapper : MonoBehaviour
{
[SerializeField] private GameObject playerPrefab;
private void Start()
{
NetworkManager.Singleton.StartServer();
GameObject go = Instantiate(playerPrefab);
go.GetComponent<NetworkObject>().SpawnAsPlayerObject(NetworkManager.Singleton.LocalClientId);
}
}