Example #1
0
 void PickValuable()
 {
     if (valuables.Count > 0)
     {
         targetValuable = valuables[Random.Range(0, valuables.Count)];
     }
     else
     {
         targetValuable = null;
     }
 }
Example #2
0
 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();
         }
     }
 }