@@ -84,7 +84,7 @@ private static void DoPaste() {
8484
8585 [ MenuItem ( "Assets/IO/Paste %v" , true ) ]
8686 private static bool DoPasteValidate ( ) {
87- return DefaultValidation ( ) && ( _copyBuffer != null && _copyBuffer . Count > 0 ) || ( _cutBuffer != null && _cutBuffer . Count > 0 ) ;
87+ return DefaultValidation ( false ) && ( _copyBuffer != null && _copyBuffer . Count > 0 ) || ( _cutBuffer != null && _cutBuffer . Count > 0 ) ;
8888 }
8989
9090 [ MenuItem ( "Assets/IO/Cut %x" , false , PRIORITY ) ]
@@ -124,14 +124,18 @@ private static bool DoCutCancelValidate() {
124124 return DefaultValidation ( ) && _cutBuffer != null && _cutBuffer . Count > 0 ;
125125 }
126126
127- private static bool DefaultValidation ( ) {
128- return ValidateNotRestrictedPath ( ) && CollectAssetItems ( ref _tmpBuffer ) ;
127+ private static bool DefaultValidation ( bool restrictAssets = true ) {
128+ return ValidateNotRestrictedPath ( restrictAssets ) && CollectAssetItems ( ref _tmpBuffer ) ;
129129 }
130130
131- private static bool ValidateNotRestrictedPath ( ) {
131+ private static bool ValidateNotRestrictedPath ( bool restrictAssets = true ) {
132132 string path = AssetDatabase . GetAssetPath ( Selection . activeObject ) ;
133133
134- return ! string . IsNullOrEmpty ( path ) && ! path . Equals ( "Assets" ) && ! path . StartsWith ( "Packages" ) ;
134+ if ( restrictAssets && path . Equals ( "Assets" ) ) {
135+ return false ;
136+ }
137+
138+ return ! string . IsNullOrEmpty ( path ) && ! path . StartsWith ( "Packages" ) ;
135139 }
136140
137141 private static void OnProjectGUI ( string guid , Rect selectionRect ) {
@@ -163,9 +167,18 @@ private static bool CollectAssetItems(ref Dictionary<string, List<AssetItem>> ou
163167 bool hasFolderSelected = false ;
164168
165169 foreach ( Object o in objects ) {
170+ if ( ! AssetDatabase . IsMainAsset ( o ) ) {
171+ continue ;
172+ }
173+
166174 string path = AssetDatabase . GetAssetPath ( o ) . Replace ( '/' , '\\ ' ) ;
167175 string [ ] parentSplit = path . Split ( '\\ ' ) ;
168176 string parent = Path . GetDirectoryName ( path ) ;
177+
178+ if ( string . IsNullOrEmpty ( parent ) ) {
179+ continue ;
180+ }
181+
169182 AssetItem item = new AssetItem ( path ) ;
170183
171184 if ( item . IsFolder ) {
0 commit comments