Пример #1
0
        private static void RefreshEditable()
        {
            Object[] selection = Selection.objects;
            if (selection == null || selection.Length == 0)
            {
                previousSelectionHash = 0;
            }
            else if (previousSelectionHash != GetSelectionHash(ref selection))
            {
                MakePreviousEditable();
                foreach (var selectionIt in selection)
                {
                    if (selectionIt is Material)
                    {
                        EditableManager.RefreshEditableMaterial(selectionIt as Material);
                    }
                    else if (selectionIt is GameObject)
                    {
                        EditableManager.RefreshEditableObject(selectionIt as GameObject);
                    }
                }

                previousSelection     = selection;
                previousSelectionHash = GetSelectionHash(ref selection);
            }
        }
Пример #2
0
        private static void MakeEditable(Object obj)
        {
            EditableManager.SetEditable(obj, true);
            GameObject go = obj as GameObject;

            if (go)
            {
                foreach (var componentIt in go.GetComponents <Component>())
                {
                    EditableManager.SetEditable(componentIt, true);
                }
            }
        }