Initial Commit

This commit is contained in:
jellejurre
2025-07-19 01:03:02 +02:00
commit e7904e3140
304 changed files with 22521 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
using UnityEngine;
using UnityEditor;
using System.IO;
namespace DreadScripts.CopyCutPaste
{
public class CopyCutPaste
{
private static bool copy;
private static string[] _tempGUID;
private static string[] assetsGUID;
[MenuItem("Assets/Copy", false, 20)]
private static void Copy()
{
copy = true;
assetsGUID = _tempGUID;
}
[MenuItem("Assets/Cut", false, 20)]
private static void Cut()
{
copy = false;
assetsGUID = _tempGUID;
}
[MenuItem("Assets/Paste", false, 20)]
private static void Paste()
{
string folderPath = AssetDatabase.GetAssetPath(Selection.activeObject);
Move(folderPath, assetsGUID, copy);
}
public static void Move(string destination, string[] assetsGUID, bool copy)
{
if (!string.IsNullOrEmpty(Path.GetExtension(destination)) && !AssetDatabase.IsValidFolder(destination))
destination = Path.GetDirectoryName(destination);
try
{
AssetDatabase.StartAssetEditing();
foreach (string s in assetsGUID)
{
string filePath = AssetDatabase.GUIDToAssetPath(s);
string fileName = Path.GetFileName(filePath);
if (copy)
{
AssetDatabase.CopyAsset(filePath, AssetDatabase.GenerateUniqueAssetPath(destination + "/" + fileName));
}
else
{
if (destination + "/" + fileName != filePath)
AssetDatabase.MoveAsset(filePath, AssetDatabase.GenerateUniqueAssetPath(destination + "/" + fileName));
}
}
}
catch(System.Exception e) { Debug.LogError(e);}
finally
{
AssetDatabase.StopAssetEditing();
}
}
[MenuItem("Assets/Copy", true, 20)]
[MenuItem("Assets/Cut", true, 20)]
private static bool ValidateSelect()
{
_tempGUID = Selection.assetGUIDs;
return _tempGUID.Length > 0;
}
[MenuItem("Assets/Paste", true, 20)]
private static bool ValidateMove()
{
return (assetsGUID != null && assetsGUID.Length > 0 && Selection.activeObject);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e426aee4657d89e48be7f5d84c4adbdd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
{
"name": "com.dreadscripts.copycutpaste.Editor",
"references": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 76bf5f01c2ff3744eab2e7b22276e902
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: