protected override void OnTriggerEnter(Collider other) { GameObject col = other.gameObject; // Ignore collisions with launcher or if currently being held if (col == LauncherStats.gameObject || _interactable.IsPickedUp) { return; } // if other object is a player, deal damage if (col.CompareTag("Player")) { EntityStatsController target = col.GetComponent <EntityStatsController>(); target.TakeDamage(LauncherStats, Damage); } else if (col.CompareTag("Enemy") && LaunchedByPlayer) { RhakStatsController target = col.GetComponent <RhakStatsController>(); // Ensure that the boss was hit if (target) { target.TakeDamageFromOrb(_colour); } } // Don't worry about collisions with colliders that are triggers if (!other.isTrigger) { gameObject.SetActive(false); } }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { _combat = animator.GetComponent <RhakCombatController>(); _stats = animator.GetComponent <RhakStatsController>(); _motor = animator.GetComponent <EnemyMotorController>(); _combat.StartBulletHell(); _motor.StartRotate(); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { _stats = animator.GetComponent <RhakStatsController>(); // Trigger the death event _stats.RhakDeath(); // Set the timer to trigger fade animation _timer = Mathf.Max(deathDuration, stateInfo.length); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { _stats = animator.GetComponent <RhakStatsController>(); }