void Awake() { // Get reference to the VehiclePrefabs which contains a list of the available prefabs for the player. if (!playerVehiclePrefabs) { playerVehiclePrefabs = GetComponentInChildren <VehiclePrefabs>(); } if (!playerVehiclePrefabs) { Debug.LogWarning("No player VehiclePrefabs specified or found for PlayerRespawner on " + name); } // De-activate the timer initially, no need to see it now. if (timer) { timer.gameObject.SetActive(false); // Subscribe to time complete event. timer.timerComplete += OnTimerComplete; } else { Debug.LogWarning("No Timer set for PlayerRespawner on " + name); } // Subscribe to player started event. Events.playerEntityStarted += OnPlayerEntityStarted; }
void Awake() { // Obtain reference to path if not already specified. if (!path) { path = GetComponentInChildren <WaypointPath>(); } if (path) { spawnsLeft = spawnNumber; } else { Debug.LogWarning("No WaypointPath specified or found for WaypointAISpawner on " + name); } // Obtain reference to vehicle prefabs if not already specified. if (!vehiclePrefabs) { vehiclePrefabs = GetComponentInChildren <VehiclePrefabs>(); } if (!vehiclePrefabs) { Debug.LogWarning("No VehiclePrefabs specified or found for WaypointAISpawner on " + name); } }
void Awake() { // Get reference to the VehiclePrefabs which contains a list of the available prefabs for the player. if (!playerVehiclePrefabs) { playerVehiclePrefabs = GetComponentInChildren <VehiclePrefabs>(); } if (!playerVehiclePrefabs) { Debug.LogWarning("No player VehiclePrefabs specified or found for PlayerRespawner on " + name); } // Get reference to PlayerDriver playerDriver = GetComponentInChildren <PlayerDriver>(); if (!playerDriver) { Debug.LogWarning("Unable to find PlayerDriver for PlayerCycleVehicle on " + name); } }