예제 #1
0
    public StatusEffect Burning(Transform target)
    {
        GameObject burningObject = null;

        if (_statusEffects.Count == 0)
        {
            burningObject = StatusPoolManager.Instance.PopStatusEffect(StatusEffectKind.kBurning);
        }
        for (int i = 0; i < _statusEffects.Count; i++)
        {
            //2번생성되는 것을 방지
            if (_statusEffects[i].Kind == StatusEffectKind.kBurning)
            {
                burningObject = currentBurningObj;
            }
            else
            {
                burningObject = StatusPoolManager.Instance.PopStatusEffect(StatusEffectKind.kBurning);
            }
        }
        currentBurningObj = burningObject;
        _statusEffect     = burningObject.GetComponent <BurningStatusEffect>();
        _statusEffect.BurningTarget(target);

        return(_statusEffect);
    }