public static void SortSmartNext() { Events.Pause("On Hierarchy Changed"); int index = DataBehaviour.processIndex; var sorting = DataBehaviour.sorting; bool canceled = true; if (index < DataBehaviour.sorting.Length - 1) { var current = DataBehaviour.sorting[index]; float total = (float)index / sorting.Length; string message = index + " / " + sorting.Length + " -- " + current.GetPath(); canceled = EditorUI.DrawProgressBar("Sorting All Components", message, total); current.PauseValidate(); DataBehaviour.SortSmartTarget(current); current.ResumeValidate(); } DataBehaviour.processIndex += 1; if (canceled || index + 1 > sorting.Length - 1) { EditorUI.ClearProgressBar(); Events.Remove("On Editor Update", DataBehaviour.SortSmartNext); Events.Resume("On Hierarchy Changed"); } }
public static void SortSmartSelected() { foreach (var target in Selection.gameObjects) { DataBehaviour.SortSmartTarget(target); } }
public void SortSmart() { DataBehaviour.SortSmartTarget(this.gameObject); }