public override void ResetEntity() { base.ResetEntity(); rocketController.SetActive(true); StopCoroutine("Countdown"); if (gameObject.activeSelf) { StartCoroutine("Countdown"); } }
public override void Disable() { StopCoroutine("FreezeFrame"); Time.timeScale = 1; rocketController.SetActive(false); GameController.instance.GameOver(); }
public override void Disable() { AudioSource explosionSound = ObjectPooler.PoolObject("Sounds", "RocketHitSound").GetComponent <AudioSource>(); explosionSound.transform.position = transform.position; explosionSound.Play(); explosionParticles.Play(); boxCollider.enabled = false; rocketController.SetActive(false); }
public void GameStart() { RocketController player = ObjectPooler.PoolObject("Player").GetComponent <RocketController>(); playerController = player.GetComponent <PlayerController>(); player.gameObject.SetActive(true); player.transform.position = spawnpoint; player.SetActive(true); music.gameObject.SetActive(true); music.Play(); StartSpawnEvent(); gameStartTime = Time.time; CameraFollow.instance.SetTarget(player.transform); CameraFollow.instance.SetActive(true); }
private void SpawnObjects() { if (Random.value > spawnChance) { return; } Vector3 randomSpawn = Random.insideUnitCircle.normalized * spawnDistanceFromPlayer; int times = Random.Range(minSpawn, maxSpawn); for (int i = 0; i < times; i++) { GameObject newObject = ObjectPooler.PoolObject(spawnObject); if (newObject == null) { continue; } if (minSize != maxSize) { newObject.transform.localScale = Vector3.one * Random.Range(minSize, maxSize); } Vector3 privateSpawn = randomSpawn + (Random.insideUnitSphere * spawnRange); if (privateSpawn.x > 0) { privateSpawn.x += 25; } else { privateSpawn.x -= 25; } privateSpawn.z = 0; newObject.transform.position = PlayerController.instance.transform.position + privateSpawn; RocketController newRocketController = newObject.GetComponent <RocketController>(); if (newRocketController != null) { newRocketController.SetActive(true); } Entity newEntity = newObject.GetComponent <Entity>(); if (newEntity != null) { newEntity.ResetEntity(); } } }
public override void Disable() { StopCoroutine("SlowUpdateRoutine"); rocketController.DisableEffects(); rocketController.SetActive(false); //disables collider, so this method can only be called once }
public override void Disable() { rocketController.DisableEffects(); rocketController.SetActive(false); //disables collider, so this method can only be called once }