Ejemplo n.º 1
0
    private IEnumerator killTarget()
    {
        yield return(new WaitForSeconds(secoundToDie));

        target = GetComponent <IDestroyable>();
        if (target != null)
        {
            target.kill();
        }
        else
        {
            Destroy(gameObject);
        }
    }