Beispiel #1
0
    /// <summary>
    /// Applies damage in case we touch the cat.
    /// </summary>
    /// <param name="other"></param>
    private void OnTriggerStay(Collider other)
    {
        CatController cat = other.GetComponent <CatController>();

        if (cat != null && Time.time >= nextDamage)
        {
            nextDamage = Time.time + damageInterval;
            cat.ApplyDamage(damage);
        }
    }