예제 #1
0
    protected override void OnCollisionEnter2D(Collision2D collision)
    {
        IFreezable  freezable  = collision.gameObject.GetComponent <IFreezable>();
        IDamageable damageable = collision.gameObject.GetComponent <IDamageable>();

        if (freezable != null)
        {
            damageable.TakeDamage(player.bow.dmg);
            freezable.Freze(duration);
        }
        Destroy(gameObject);
    }
예제 #2
0
    private void OnParticleCollision(GameObject other)
    {
        IFreezable fre = other.GetComponent <IFreezable>();

        rand = Random.Range(1, 100);
        if (fre != null)
        {
            fre.SlownDown(5);
            if (rand == 50)
            {
                fre.Freze(3);
            }
        }
    }
예제 #3
0
    protected override void OnCollisionEnter2D(Collision2D collision)
    {
        IFreezable  freezable  = collision.gameObject.GetComponent <IFreezable>();
        IDamageable damageable = collision.gameObject.GetComponent <IDamageable>();

        if (freezable != null)
        {
            damageable.TakeDamage(player.bow.dmg);
            int rand = Random.Range(1, 100);
            if (rand < slowChance)
            {
                freezable.SlownDown(slowDuration);
            }
            if (rand < frezeChance)
            {
                freezable.Freze(frezeDuration);
            }
        }
        Destroy(gameObject);
    }