/// <summary> /// Creates the players based on the controllers the controller manager offers. /// </summary> void CreatePlayers() { ControllerManager cm = ControllerManager.Get(); if (cm != null) { cm.ControllerConnectedEvent += new OnControllerConnectedHandler(OnControllerConnected); cm.ControllerDisconnectedEvent += new OnControllerDisconnectedHandler(OnControllerDisconnected); } else { Debug.LogError("ControllerManager is not initialized properly!"); } }
// Use this for initialization void Start() { int playerCount = ControllerManager.Get().MaximumUsable; playersEnded = new bool[playerCount]; sectorNumber = new int[playerCount]; currentSectors = new SectorData[playerCount]; started = false; ended = false; if (Generator != null) { Generator.Load(currentLevel = Generator.Generate(GeneratorSectorBowl)); InitialCreate(); } }
/// <summary> /// Spawns in the first module of this level. /// </summary> static void InitialCreate() { for (int i = 0; i < sectorNumber.Length; i++) { sectorNumber[i] = 0; } int maxSpawns = Mathf.Min(2, ControllerManager.Get().MaximumUsable); for (int i = 0; i < maxSpawns; i++) { Player p = PlayerManager.Get().GetPlayer(i); PlayerNextSector(currentLevel.Sectors[0], p); ICharacter c = Create(p); UseCharacter(p, c); CharacterSpawn spawner = currentSectors[p.PlayerIndex].SpawnModule.Spawns[(int)c.CharacterType]; c.Spawn(spawner); } started = true; }
public override void Enter() { ControllerManager.Get().MaximumUsable = 1; Application.LoadLevel("TrainingSettings"); }
public override void Enter() { ControllerManager.Get().MaximumUsable = 1; PlayerManager.Get().ActivatePlayer(0); Application.LoadLevel("Training"); }
public override void Enter() { ControllerManager.Get().MaximumUsable = 1; Application.LoadLevel("MainMenu"); }