Пример #1
0
    public void OnTriggerStay(Collider collider)
    {
        GameObject other = collider.gameObject;
        Donut      donut = other.GetComponent <Donut> ();

        if (donut != null)
        {
            donut.TakeDamage(this.damage);
        }
    }
Пример #2
0
    /* Hal Assisted Code*/
    public IEnumerator Fire(Donut donut)
    {
        if (donut != null)
        {
            donut.TakeDamage(this.damage);
            ableToFire = false;
            Debug.Log("BOOM");
            yield return(new WaitForSeconds(atkSpeed));

            Debug.Log("RELOAD");
            ableToFire = true;
        }
    }