Example #1
0
    protected virtual void OnTriggerEnter2D(Collider2D other)
    {
        target = other.transform.root.GetComponent <ISpeedable>();

        //Hit the target if it is damageable
        if (target != null)
        {
            target.SpeedEffect(speedBoost, effectTime);
            Destroy(gameObject);
        }
    }
    protected virtual void SetIce(bool active, float length = 0)
    {
        frozen = active;
        if (iceParticles != null)
        {
            iceParticles.SetActive(active);
        }

        if (active && movement != null)
        {
            movement.SpeedEffect(-iceSlowMultiplier, length);
        }
    }