public override void Reset() { base.Reset(); Health = Controller.GetComponent <HedgehogHealth>(); Vulnerable = true; Harmful = false; OnKillEnemy = new EnemyEvent(); HarmfulTag = LethalTag = ""; }
/// <summary> /// Method from MonoBehaviour. The first one to be called when the Scene loads. /// This will be where all the enemies and their spawn times be created. /// Updated: April 7, 2021 /// </summary> private void Awake() { // Create 3 sets of enemies that will spawn later. EnemyEvent fast_enemy = new EnemyEvent(); EnemyEvent slow_enemy = new EnemyEvent(); EnemyEvent mix_enemy = new EnemyEvent(); // Create a boss event. EnemyEvent boss_event = new EnemyEvent(); // Incase the enemy list is empty. try { // Group all the fast enemies into a set. fast_enemy.Add(enemy_list[1]); fast_enemy.Add(enemy_list[1]); fast_enemy.Add(enemy_list[1]); // Make a set of all slow enemies. slow_enemy.Add(enemy_list[0]); slow_enemy.Add(enemy_list[0]); slow_enemy.Add(enemy_list[0]); // Make a set that is a mix of fast and slow enemies. mix_enemy.Add(enemy_list[0]); mix_enemy.Add(enemy_list[1]); mix_enemy.Add(enemy_list[1]); mix_enemy.Add(enemy_list[0]); // Add a boss gameobject to a boss event. boss_event.Add(boss); } catch (Exception ex) { Console.WriteLine(ex); } // Begin adding the enemy events to the object EnemyEvent[] all_waves = { fast_enemy, slow_enemy, mix_enemy }; // Add the events to a Dictionary with a set amount of time. for (int x = 0; x < spawnTimeList.Length; x++) { // Randomly choose enemy event and give it a timeslot. int randomIndex = UnityEngine.Random.Range(0, all_waves.Length); spawnList.Add(spawnTimeList[x], all_waves[randomIndex]); } // Set a time for the boss to spawn. spawnList.Add(30, boss_event); }
public override void Awake() { base.Awake(); OnDeathComplete = OnDeathComplete ?? new UnityEvent(); OnEnemyKilled = OnEnemyKilled ?? new EnemyEvent(); Controller = Controller ?? GetComponentInParent <HedgehogController>(); HurtReboundMove = HurtReboundMove ?? Controller.GetComponent <MoveManager>().Get <HurtRebound>(); RingCounter = RingCounter ?? GetComponentInChildren <RingCounter>(); HurtInvincibilityTimer = 0.0f; HurtInvincibleBoolHash = Animator.StringToHash(HurtInvincibleBool); }
void Awake() { AudioHandler.Load(CRASH_SFX); if (OnStruck == null) { OnStruck = new EnemyEvent(); } if (OnDie == null) { OnDie = new EnemyEvent(); } if (OnGone == null) { OnGone = new EnemyEvent(); } LaserPool.Fill(); LaserCrashPool.Fill(); CrashPool.Fill(); _camera = Camera.main; }
public override void Reset() { base.Reset(); RingLossSound = null; ReboundSound = null; DeathSound = null; SpikeTag = ""; SpikeSound = null; OnDeathComplete = new UnityEvent(); OnEnemyKilled = new EnemyEvent(); Controller = GetComponentInParent <HedgehogController>(); HurtReboundMove = Controller.GetMove <HurtRebound>(); DeathMove = Controller.GetMove <Death>(); RingCounter = GetComponentInChildren <RingCounter>(); RingsLost = 9001; HurtInvinciblilityTime = 2.0f; }
public void Ctor(EnemyEvent self, float speed) { this.Image.texture = this.sprites[self.KillKey].texture; this.LocationHandler = new LocationHandler(speed, self.SpawnTime, self.Rotation, Assets.Instance.Settings.ElementsSize); this.KillKey = self.KillKey; }
public override void Awake() { base.Awake(); OnKillEnemy = OnKillEnemy ?? new EnemyEvent(); }
public virtual void Here(EnemyEvent boss, Transform playa) { _parent = boss; _target = playa; }
private void CreateEnemy(EnemyEvent self) { GameObject enemyInstance = Instantiate(this.enemy, this.transform, false); enemyInstance.GetComponent <HitObject>().Ctor(self, Assets.Instance.Settings.IncomingSpeed); }
private void OnDestroy() { IDied = null; }