// Use this for initialization void Start() { server = GameManager.gameManager.ClientController; server.Register ( this ); string weaponType = ""; switch(shipHull.weapon.gunType){ case GunType.CANNON: weaponType = "Cannon"; break; case GunType.SEEKERMISSILELAUNCHER: weaponType = "Seeker Missile Launcher"; break; default: weaponType = "Cannon"; break; } model = (GameObject)Instantiate(GameManager.gameManager.ShipModelPrefab); model.transform.parent = transform; shield = (GameObject)Instantiate(GameManager.gameManager.ShipShieldPrefab); shield.transform.parent = transform; server.Send(DataType.SPAWNED, weaponType); server.OnEvent("spawn", GameManager.gameManager.prespawnData); }
void OnLevelWasLoaded(int id) { if (id == 3) { server = GameManager.gameManager.ClientController; server.Register(this); //server.Send(DataType.JOINGAME, "lobby"); createdGames = new List<string>(); createdGames.Add(""); server.Send(DataType.GAMES_GET, null); AddQueuedGames(); } }