void PickValuable() { if (valuables.Count > 0) { targetValuable = valuables[Random.Range(0, valuables.Count)]; } else { targetValuable = null; } }
void UpdateAttacks() { for (int i = valuables.Count - 1; i >= 0; i--) { ValuableActor attackTarget = valuables[i]; if (attackTarget.isValid && Vector3.Distance(attackTarget.transform.position, transform.position) < 1f) { valuables.Remove(attackTarget); attackTarget.Break(); } } }