// Use this for initialization void Start() { HeyzapAds.Start("f62dff4e4bbf49a67e29252338b6d0d7", HeyzapAds.FLAG_NO_OPTIONS); HZIncentivizedAd.Fetch(); fpsPlayerRef.GetComponent <FPSPlayer>(); fpsPlayerTransform = fpsPlayerRef.GetComponent <Transform>(); originalPosition = fpsPlayerTransform.position; originalRotation = fpsPlayerTransform.rotation; weapons.GetComponent <PlayerWeapons> (); }
// Use this for initialization void Start() { fpsController = player.GetComponent <FirstPersonController> (); remainingZombies = 0; wave = 0; spawnLocations = new List <SpawnLocation>(spawnLocationsContainer.GetComponentsInChildren <SpawnLocation> ()); ammoSpawnLocations = new List <ItemSpawnLocation>(ammoSpawnLocationsContainer.GetComponentsInChildren <ItemSpawnLocation> ()); healthSpawnLocations = new List <ItemSpawnLocation>(healthSpawnLocationsContainer.GetComponentsInChildren <ItemSpawnLocation> ()); spawnTimer = new CounterTimer(0.5f); waveTimer = new CounterTimer(wavesInterval); Status = Spo2GameStatus.Playing; }
// • • • • • • • • • • • • • • • • • • • • // // // U s e r // public void SetEnemies() { #if UNITY_EDITOR if (!player) { player = FindObjectOfType <FPSPlayer>(); } if (!player) { Debug.LogError("Could not find the player in this level"); return; } #else // Get the player from the service locator if (!player) { player = Locator.Get <FPSPlayer>(); } #endif // E x i t if (null == enemies || 0 == enemies.Length) { return; } // Get the player collider Collider playerCollider = player ? player.GetComponent <Collider>() : null; foreach (Enemy enemy in enemies) { // C o n t i n u e if (enemy.set) { continue; } // Set the manager enemy.manager = this; // Set the target enemy.target = player.transform; // Set the target bounds enemy.targetBounds = (null != playerCollider) ? playerCollider.bounds : default(Bounds); // Debug DebugEnemy(enemy); #if UNITY_EDITOR EditorSceneManagement.MarkSceneDirty(SceneManagement.Active); EditorUtility.SetDirty(enemy); #endif } }