コード例 #1
0
        static private void OpenConfigWindow(string guid, Vector2 position)
        {
            string assetPath   = AssetDatabase.GUIDToAssetPath(guid);
            Object objSelected = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Object));

            var type = File.GetAttributes(assetPath);

            if ((type & FileAttributes.Directory) != FileAttributes.Directory)
            {
                EditorUtility.DisplayDialog("Not a folder", "You must select a folder", "Ok"); return;
            }

            CustomIconsWindow.CreateWindow(position, databaseRef, guid, objSelected);
        }
コード例 #2
0
        static private void ContextMenu()
        {
            if (databaseRef == null)
            {
                FindDatabaseReference(); return;
            }
            if (Selection.assetGUIDs.Length == 0)
            {
                EditorUtility.DisplayDialog("Selection Empty", "You must select a folder", "Ok"); return;
            }
            string assetPath   = AssetDatabase.GUIDToAssetPath(Selection.assetGUIDs[0]);
            Object objSelected = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Object));

            var type = File.GetAttributes(assetPath);

            if ((type & FileAttributes.Directory) != FileAttributes.Directory)
            {
                EditorUtility.DisplayDialog("Not a folder", "You must select a folder", "Ok"); return;
            }

            CustomIconsWindow.CreateWindow(new Vector2(600, 600), databaseRef, Selection.assetGUIDs[0], objSelected);
        }