protected static void LoadMaps() { UnityEngine.Object[] _availableMaps = Resources.LoadAll(@"Maps"); CSMapPrefab map; foreach (UnityEngine.Object t in _availableMaps) { map = new CSMapPrefab(); map._model = (GameObject)t; map._name = ((GameObject)t).name; maps.Add(map); } }
protected void InitServer() { if (Network.InitializeServer(MaxConnections, _port) == NetworkConnectionError.NoError) { //init map _choosingMap = PrefabLoader.GetMapModel(CSMapsName.cs_mansion); Instantiate(_choosingMap, Vector3.zero, Quaternion.LookRotation(Vector3.forward, Vector3.up)); //init player Transform generator = CSMapPrefab.GetGenerator(_team, CSMapsName.cs_mansion); _player = PrefabLoader.GetCharacterModel(CSCharactersName.player); Instantiate(_player, generator.transform.position, generator.rotation); Screen.showCursor = false; _gameState = GameState.PLAYING; } }