示例#1
0
        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");
            }
        }
示例#2
0
 public static void SortSmartSelected()
 {
     foreach (var target in Selection.gameObjects)
     {
         DataBehaviour.SortSmartTarget(target);
     }
 }
示例#3
0
 public void SortSmart()
 {
     DataBehaviour.SortSmartTarget(this.gameObject);
 }