Beispiel #1
0
    private void OnTriggerEnter(Collider col)
    {
        if (col.tag != enemyTag || !placed || disappear)
        {
            return;
        }

        Enemy e = col.GetComponent <Enemy>();

        e.ActivateDebuff(debuffIntensity, Mathf.Infinity, debuffType);
    }
Beispiel #2
0
    private void OnTriggerExit(Collider col)
    {
        if (col.tag != enemyTag || placed == false)
        {
            return;
        }

        Enemy e = col.GetComponent <Enemy>();

        e.ActivateDebuff(debuffIntensity, debuffDuration, debuffType);
    }
Beispiel #3
0
    private void Update()
    {
        if (!placed)
        {
            return;
        }
        duration -= Time.deltaTime;

        if (duration <= 0f && !disappear)
        {
            disappear = true;
            Collider[] colliders = Physics.OverlapSphere(transform.position, 2.5f);
            foreach (Collider col in colliders)
            {
                if (col.tag == enemyTag)
                {
                    Enemy e = col.GetComponent <Enemy>();
                    e.ActivateDebuff(debuffIntensity, debuffDuration, debuffType);
                }
            }
            Destroy(gameObject);
        }
    }