// Use this for initialization void Start() { GameLevelSceneManager.instance = this; networkManager = (ExtendedNetworkManager)NetworkManager.singleton; networkDiscovery = networkManager.networkDiscovery; SetGameVisibility(true); }
// Use this for initialization void Start() { SafeInit(); if (isLocalPlayer) { isPause = false; isTeamSelected = false; isReadyForGame = false; sceneManager = GameLevelSceneManager.instance; DisplayShipConfigMenu(); sphereCollider = GetComponent <SphereCollider>(); enemyShipMap = new Dictionary <ShipController, GameObject>(); allyShipMap = new Dictionary <ShipController, GameObject>(); GameLevelEventManager.ShipDestroyedEvent += HandleShipExitVecinity; } else { GetComponent <SphereCollider>().enabled = false; //TODO Investigate this and lets make it compact foreach (Transform child in transform) { if (child.name == "MainPlayerCamera" || child.name == "HUD") { GameObject.Destroy(child.gameObject); } } if (isReadyForGame) { RefreshTeamState(); RefreshShipType(); } } }
/// <summary> /// This method will be called when the user selects a team. /// </summary> /// <param name="teamTag"></param> public static void OnTeamSelectMenuTeamSelected(GameLevelSceneManager.TEAMTAG teamTag) { Assert.IsNotNull(TeamSelectMenuTeamSelectedEvent); if (TeamSelectMenuTeamSelectedEvent != null) { TeamSelectMenuTeamSelectedEvent(teamTag); } }
// Set the team for this ship and apply any logic needed public void SetTeam(GameLevelSceneManager.TEAMTAG teamTag) { this.teamTag = teamTag; }
void OnDestroy() { SetGameVisibility(false); GameLevelSceneManager.instance = null; }
// Use this for initialization void Start() { SafeInit(); if (isLocalPlayer) { isPause = false; isTeamSelected = false; isReadyForGame = false; sceneManager = GameLevelSceneManager.instance; DisplayShipConfigMenu(); sphereCollider = GetComponent<SphereCollider>(); enemyShipMap = new Dictionary<ShipController, GameObject>(); allyShipMap = new Dictionary<ShipController, GameObject>(); GameLevelEventManager.ShipDestroyedEvent += HandleShipExitVecinity; } else { GetComponent<SphereCollider>().enabled = false; //TODO Investigate this and lets make it compact foreach (Transform child in transform) { if (child.name == "MainPlayerCamera" || child.name == "HUD") { GameObject.Destroy(child.gameObject); } } if (isReadyForGame) { RefreshTeamState(); RefreshShipType(); } } }
/// <summary> /// This method will be called when the user selects a team. Here the player should be configured to match the team settings. /// </summary> /// <param name="teamTag"></param> public void OnTeamSelectMenuTeamSelected(GameLevelSceneManager.TEAMTAG teamTag) { GameLevelEventManager.TeamSelectMenuTeamSelectedEvent -= OnTeamSelectMenuTeamSelected; CmdDoSetTeam(teamTag); isTeamSelected = true; GameLevelEventManager.ShipConfigMenuShipSelectedEvent += OnShipConfigMenuShipSelected; sceneManager.DisplayShipSelectMenu(); }
// Use this for initialization void Start() { GameLevelSceneManager.instance = this; networkManager = (ExtendedNetworkManager)NetworkManager.singleton; networkDiscovery = networkManager.networkDiscovery; SetGameVisibility(true); }
void OnDestroy() { SetGameVisibility(false); GameLevelSceneManager.instance = null; }