Exemplo n.º 1
0
    private void MoveToNearestEnemy(EnemyView hitedEnemy)
    {
        EnemyView enemy = gameField.FindeNearestEnemy(hitedEnemy);

        if (enemy != null)
        {
            direction = (enemy.transform.position - transform.position).normalized;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }