public void TryAutomaticGrowingSettings() { Hirarchy hirarchy = GetHirarchy(transform); while (true) { List <GrowingPart> currentGrowingParts = hirarchy.NextParts(); for (int index = 0; index < currentGrowingParts.Count; index++) { var currentPart = currentGrowingParts[index]; currentPart.currentBaseStateIndex = StateOrder.Count; currentPart.UpdateMinMaxTime(this); currentPart.startTime = currentPart.minTime + hirarchy.CurrentProzent * (currentPart.maxTime - currentPart.minTime); currentPart.endTime = currentPart.startTime + hirarchy.ProzentPerPart * (currentPart.maxTime - currentPart.minTime); #if UNITY_EDITOR EditorUtility.SetDirty(currentPart); #endif } if (hirarchy.IsLast) { break; } } }