Esempio n. 1
0
    private IEnumerator IEDeathEffect()
    {
        _hp.SetDieState();
        GameMng.CharMng.RemoveChar(UniqueID);

        _animator.SetTrigger("Die");
        while (_animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1)
        {
            yield return(null);
        }


        float elapsedTime = 0;
        float targetTime  = 1.6f;


        _status.RandomItem();
        Color originColor = Renderer.color;

        while (elapsedTime <= targetTime)
        {
            elapsedTime   += Time.deltaTime;
            Renderer.color = Color.Lerp(originColor, Color.clear, elapsedTime);
            yield return(null);
        }

        GameMng.Pool.MonsterPush(Data._name, this);

        Renderer.color = originColor;
    }