calculatePriority method

void calculatePriority()

Calculate the priority when the owner object changes.

Implementation

void calculatePriority() {
  final index = owner.slices.indexOf(this);
  final betweenSlices = owner.size.z / owner.slices.length;
  priority = (owner.position.z + index + betweenSlices * index).toInt();
}