Beispiel #1
0
    public IEnumerator ActivateNKC(float time)
    {
        stats.ActivateNKC();
        bullet = combat.GetBullet();
        combat.ChangeBullet(NKCBullet);
        animator.SetBool("NKC", true);

        yield return(new WaitForSeconds(time));

        animator.SetBool("NKC", false);
        combat.ChangeBullet(bullet);
        stats.DeactivateNKC();
    }
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Player"))
        {
            PlayerCombat combat = other.gameObject.GetComponent <PlayerCombat>();
            if (combat != null)
            {
                Debug.Log("Player entered changer");

                Instantiate(activateEffect[bullet.GetComponent <Bullet>().GetBulletType()],
                            transform.position, transform.rotation);

                prevBullet = combat.GetBullet();
                combat.ChangeBullet(bullet);
                bullet = prevBullet;

                animator.SetTrigger(bulletColor[bullet.GetComponent <Bullet>().GetBulletType()]);
            }
        }
    }