Пример #1
0
        protected virtual void OnContextMenuCallback(ReorderableList list, GenericMenu menu)
        {
            menu.AddItem(new GUIContent("Properties"), false, () =>
            {
                Selection.activeObject = list.GetSelectedObject(_childs);
                EditorApplication.ExecuteMenuItem("Assets/Properties...");
                Selection.activeObject = target;
            });

            menu.AddItem(new GUIContent("Select asset"), false, () =>
            {
                var obj = list.GetSelectedObject(_childs);
                Selection.activeObject = obj;
                EditorGUIUtility.PingObject(obj);
            });

            if (_allowExport)
            {
                menu.AddItem(new GUIContent("Export"), false, () =>
                {
                    int actionIndex = EditorUtility.DisplayDialogComplex("Warning",
                                                                         "Copy of this object will be created in parents directory. " +
                                                                         "Original object will not be deleted.",
                                                                         "Export", "Export and delete original", "Cancel");

                    if (actionIndex == 0)
                    {
                        ExportExistentChild(list.index, false);
                    }
                    else if (actionIndex == 1)
                    {
                        ExportExistentChild(list.index, true);
                    }
                });
            }
        }