public void Start()
        {
            var instMgr = GameObject.Find(InstantiationManagerName);

            if (!instMgr)
            {
                throw new System.Exception($"You must have a GameObject named {InstantiationManagerName} in your scene.");
            }
            _ClientSpawnManager = instMgr.GetComponent <ClientSpawnManager>();

            if (!_ClientSpawnManager)
            {
                throw new System.Exception($"{InstantiationManagerName} must have a ClientSpawnManager component.");
            }

            var netMgr = GameObject.Find(NetworkManagerName);

            if (!netMgr)
            {
                throw new System.Exception($"You must have a GameObject named {NetworkManagerName} in your scene.");
            }
            _NetworkUpdateHandler = netMgr.GetComponent <NetworkUpdateHandler>();

            if (!_NetworkUpdateHandler)
            {
                throw new System.Exception($"{NetworkManagerName} must have a NetworkUpdateHandler component.");
            }
        }
Пример #2
0
        public void Awake()
        {
            // instantiates this singleton in case it doesn't exist yet.
            var uiManager = Instance;

            entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;

            clientManager = ClientSpawnManager.Instance;

            if (menuPrefab == null)
            {
                throw new System.Exception("You must set a menuPrefab");
            }
        }