protected override void StopSkill() { StopAllCoroutines(); EnableTarget(); killableTarget = null; }
private IEnumerator CorDisableTarget(bool toRepeat) { if (killableTarget == null) { killableTarget = targetDetector.targets[0].gameObject.GetComponent <KillableBehaviour>(); } killableTarget.DisableMovement(); yield return(null); if (!toRepeat) { yield return(new WaitForSeconds(delaySkillStop)); EnableTarget(); } if (isOneTime && (prefabDestroyFX != null)) { yield return(new WaitForSeconds(delayDestroy)); instantiator.InjectPrefab(prefabDestroyFX, this.gameObject); Destroy(this.gameObject); } }
private List <KillableBehaviour> GetKillables() { List <KillableBehaviour> killables = new List <KillableBehaviour>(); for (int x = 0; x < detector.targets.Count; x++) { if (detector.targets[x] != null) { KillableBehaviour killable = detector.targets[x].gameObject.GetComponent <KillableBehaviour>(); if (killable != null) { killables.Add(killable); } } } return(killables); }
private void ApplySpotHit(Collider2D collider) { if (shouldHurtTarget) { KillableBehaviour killable = collider.GetComponent <KillableBehaviour>(); if (killable != null) { if (shouldInstaKillTarget) { killable.KillOnce(); } else { killable.HitOnce(); } } AudioUtil.PlaySingleClip(GetType(), clipAttack, _audioSource); } }