コード例 #1
0
    protected override void StopSkill()
    {
        StopAllCoroutines();
        EnableTarget();

        killableTarget = null;
    }
コード例 #2
0
    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);
        }
    }
コード例 #3
0
    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);
    }
コード例 #4
0
    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);
        }
    }