private void OnDisable() { OnEnemyStun -= HandleEnemyStun; OnEnemyEndStun -= HandleEnemyEndStun; OnEnemyDeath -= HandleEnemyDeath; OnEnemyEndDeath -= HandleEnemyEndDeath; LevelManager.OnPlayerDeath -= HandlePlayerDeath; }
private void Awake() { current = this; player = new PlayerEvents(); ui = new UIEvents(); spawn = new SpawnEvents(); level = new LevelEvents(); enemy = new EnemyEvents(); combat = new CombatEvents(); }
public void die() // Called only if the enemy is supposed to be destroyed by being killed, not when it's destroyed for other reasons. { life_state = LifeState.dying; Destroy(gameObject, diying_duration); launch_destruction_animation(); if (this.gameObject.CompareTag(Wave.ENEMY_TAG)) { EnemyEvents.InvokeOnKilled(this); } }
private void Awake() { instance = this; playerEvents = new PlayerEvents(); evilPlayerEvents = new EvilPlayerEvents(); enemyEvents = new EnemyEvents(); levelEvents = new LevelEvents(); enviromentEvents = new EnviromentEvents(); weaponEvents = new WeaponEvents(); itemEvents = new ItemEvents(); }
private void SetupEnemyEvents() { EnemyEvents = LevelManager.Instance.SelectedLevel.GetCurrentStar().Events; if (EnemyEvents == null) { return; } foreach (var e in EnemyEvents.RageEvents) { e.Start(enemy); } }
void TakeDamage(int dmg) { HP -= dmg; print(robotName + " has: " + HP + " remaining HP"); if (HP <= nearDeath) { roboAnim.SetBool("isHurt", true); } if (HP <= 0) { EnemyEvents.EnemyKilled(); Destroy(gameObject); } }
public void Init() { enemiesLayerValue = LayerMaskToLayer(enemiesLayerMask); enemyList = new List <IEnemy>(); stunnedEnemies = new List <IEnemy>(); deadEnemies = new List <IEnemy>(); enemyList = (FindObjectsOfType <EnemyBase>() as IEnemy[]).ToList(); enemyList.AddRange((FindObjectsOfType <Turret>() as IEnemy[]).ToList()); OnEnemyStun += HandleEnemyStun; OnEnemyEndStun += HandleEnemyEndStun; OnEnemyDeath += HandleEnemyDeath; OnEnemyEndDeath += HandleEnemyEndDeath; LevelManager.OnPlayerDeath += HandlePlayerDeath; canAddTolleranceDefaultBehaviour = canAddTollerance = true; }
public static EnemyEvents GetLevelEvents(LevelEvents.EventTrigger[] levelEvent) { var events = new EnemyEvents(); if (levelEvent == null) { return(events); } foreach (var e in levelEvent) { var result = GetEnemyEvent(e); if (result == null) { continue; } events.RageEvents.Add(result); } return(events); }
private void Awake() { instance = this; }
private void Awake() { enemyEvents = gameObject.AddComponent <EnemyEvents>(); }