internal void CloseAll() { ServerCommunicator.CloseService(); ClientCommunicator.CloseService(); LoginService.CloseService(); QLKHDataService.CloseService(); }
internal void StartAll() { ServerCommunicator.StartService(); ClientCommunicator.StartService(); LoginService.StartService(); QLKHDataService.StartService(); }
void Awake() { allMobiles = new List <GameObject>(); cComm = gameObject.GetComponent <ClientCommunicator> (); playerObject = (GameObject)Instantiate(playerPrefab, new Vector3(-7.5f, 4f), Quaternion.identity); allMobiles.Add(playerObject); spawners = new List <Spawner> (); for (int i = 0; i <= 8; i++) { GameObject newSpawner = (GameObject)Instantiate(spawnerPrefab, new Vector2(11, 4 - i), Quaternion.identity); Spawner sScript = newSpawner.GetComponent <Spawner>(); spawners.Add(sScript); sScript.spawnerIndex = i; } foreach (Object i in Resources.LoadAll("Enemies")) { GameObject enemyPrefab = (GameObject)i; Enemy enemy = enemyPrefab.GetComponent <Enemy>(); enemies.Add(enemy); foreach (Spawner j in spawners) { if (enemy.getAvailableSpawners().Contains(j.spawnerIndex)) { j.SetSpawnableEnemy(enemy); } } } foreach (Object res in Resources.LoadAll("Hits")) { GameObject soundPrefab = (GameObject)res; GameObject soundInstance = (GameObject)Instantiate(soundPrefab, transform.position, Quaternion.identity); AudioSource source = soundInstance.GetComponent <AudioSource>(); hitSounds.Add(source); } }