├── .gitignore ├── CHANGELOG.md ├── CHANGELOG.md.meta ├── Editor.meta ├── Editor ├── ScriptableObjectCopyPasteHandler.cs ├── ScriptableObjectCopyPasteHandler.cs.meta ├── ScriptableObjectCopyPasteWindow.cs └── ScriptableObjectCopyPasteWindow.cs.meta ├── LICENSE ├── LICENSE.meta ├── README.md ├── README.md.meta ├── RuceSocial.ScriptableObjectFieldCopier.asmdef ├── RuceSocial.ScriptableObjectFieldCopier.asmdef.meta ├── package.json └── package.json.meta /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Recordings can get excessive in size 18 | /[Rr]ecordings/ 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.aab 61 | *.unitypackage 62 | *.app 63 | 64 | # Crashlytics generated file 65 | crashlytics-build.properties 66 | 67 | # Packed Addressables 68 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 69 | 70 | # Temporary auto-generated Android Assets 71 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 72 | /[Aa]ssets/[Ss]treamingAssets/aa/* 73 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog for ScriptableObject Field Copier 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [1.1.2] - 2023-07-25 6 | 7 | ### Added 8 | 9 | - Implemented copy and paste operations into the context menu. Now you can perform copy-paste operations on a scriptable object directly from the context menu in the Unity Editor. 10 | - Code has been reorganized into regions for better readability and maintenance. 11 | 12 | ## [1.1.1] - 2023-07-23 13 | 14 | ### Fixed 15 | 16 | - This commit addresses the issue where some objects were being copied by reference in our ScriptableObject copying process. This was causing undesired behavior where a change in one instance would affect all copied instances. 17 | 18 | - We've now implemented a deep copy mechanism to ensure that each copied ScriptableObject is a completely separate instance, preventing changes in one from affecting the others. This fix enhances the reliability and expected behavior of our ScriptableObject copying process. 19 | 20 | 21 | ## [1.1.0] - 2023-07-23 22 | 23 | ### Added 24 | 25 | - Added listing of SerializeField fields. 26 | 27 | ## [1.0.0] - 2023-07-23 28 | 29 | ### Added 30 | 31 | - Initial release of the package. -------------------------------------------------------------------------------- /CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0536320244527ac47a35c4d3bef08ab9 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbdcb42ef6ebf064a87ea243258001f5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/ScriptableObjectCopyPasteHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using System.Runtime.Serialization; 5 | using UnityEditor; 6 | using UnityEngine; 7 | using Object = UnityEngine.Object; 8 | 9 | namespace RuceSocial.ScriptableObjectFieldCopier 10 | { 11 | public class ScriptableObjectCopyPasteHandler 12 | { 13 | private static Object copiedObject; 14 | 15 | #region MenuItems and ContextMenu 16 | 17 | #region Copy Methods 18 | 19 | [MenuItem("Assets/Copy ScriptableObject", true), MenuItem("CONTEXT/ScriptableObject/Copy", true)] 20 | public static bool ValidateCopy() 21 | { 22 | return Selection.activeObject is ScriptableObject && Selection.objects.Length == 1; 23 | } 24 | 25 | [MenuItem("Assets/Copy ScriptableObject")] 26 | public static void Copy() 27 | { 28 | copiedObject = Selection.activeObject; 29 | } 30 | 31 | [MenuItem("CONTEXT/ScriptableObject/Copy")] 32 | private static void Copy(MenuCommand command) => Copy(command.context); 33 | 34 | private static void Copy(Object unityObject) 35 | { 36 | var so = unityObject as ScriptableObject; 37 | copiedObject = so; 38 | } 39 | 40 | #endregion 41 | 42 | #region Paste Methods 43 | 44 | [MenuItem("Assets/Paste ScriptableObject", true)] 45 | public static bool ValidatePaste() 46 | { 47 | if (copiedObject == null) return false; 48 | 49 | Type type = copiedObject.GetType(); 50 | 51 | foreach (var selectedObject in Selection.objects) 52 | { 53 | if (selectedObject.GetType() == type) 54 | return true; 55 | } 56 | 57 | return false; 58 | } 59 | 60 | [MenuItem("CONTEXT/ScriptableObject/Paste", true)] 61 | private static bool ValidatePaste(MenuCommand command) => ValidatePaste(); 62 | 63 | 64 | [MenuItem("Assets/Paste ScriptableObject")] 65 | public static void Paste() 66 | { 67 | ScriptableObjectCopyPasteWindow.OpenWindow(copiedObject as ScriptableObject); 68 | } 69 | 70 | [MenuItem("CONTEXT/ScriptableObject/Paste")] 71 | private static void Paste(MenuCommand command) => Paste(); 72 | 73 | [ContextMenu("Paste")] 74 | public static void Paste(Object unityObject) 75 | { 76 | ScriptableObjectCopyPasteWindow.OpenWindow(copiedObject as ScriptableObject); 77 | } 78 | 79 | #endregion 80 | 81 | #endregion 82 | 83 | #region Operation Methods 84 | 85 | public static List GetEligibleObjects(Object copiedObject) 86 | { 87 | List eligibleObjects = new List(); 88 | 89 | Type type = copiedObject.GetType(); 90 | if (type == null) return eligibleObjects; 91 | 92 | foreach (var selectedObject in Selection.objects) 93 | { 94 | if (selectedObject.GetType() == type) 95 | { 96 | eligibleObjects.Add(selectedObject); 97 | } 98 | } 99 | 100 | return eligibleObjects; 101 | } 102 | 103 | public static void PasteSelectedValues(Object copiedObject, Dictionary fieldInfoList) 104 | { 105 | ScriptableObjectCopyPasteHandler.copiedObject = copiedObject; 106 | 107 | List eligibleObjects = GetEligibleObjects(copiedObject); 108 | int counter = 0; 109 | foreach (var selectedObject in eligibleObjects) 110 | { 111 | Undo.RecordObject(selectedObject, "Paste ScriptableObject Values"); 112 | 113 | foreach (var fieldInfo in fieldInfoList.Keys) 114 | { 115 | if (fieldInfoList[fieldInfo]) 116 | { 117 | object value = fieldInfo.GetValue(copiedObject); 118 | object copiedValue = CopyValue(value); 119 | fieldInfo.SetValue(selectedObject, copiedValue); 120 | } 121 | } 122 | 123 | EditorUtility.SetDirty(selectedObject); 124 | counter++; 125 | } 126 | 127 | Debug.Log( 128 | $"Paste operation completed on {counter} objects"); 129 | } 130 | 131 | private static object CopyValue(object original) 132 | { 133 | try 134 | { 135 | if (original == null) 136 | { 137 | return null; 138 | } 139 | 140 | Type type = original.GetType(); 141 | 142 | if (type.IsValueType || type == typeof(string)) 143 | { 144 | return original; 145 | } 146 | else if (type.IsArray) 147 | { 148 | Type elementType = type.GetElementType(); 149 | var array = original as Array; 150 | Array copied = Array.CreateInstance(elementType, array.Length); 151 | Array.Copy(array, copied, array.Length); 152 | return Convert.ChangeType(copied, original.GetType()); 153 | } 154 | else if (original is Object) 155 | { 156 | return original; 157 | } 158 | else if (original is AnimationCurve originalCurve) 159 | { 160 | AnimationCurve copiedCurve = new AnimationCurve(originalCurve.keys); 161 | return copiedCurve; 162 | } 163 | else if (original is Gradient originalGradient) 164 | { 165 | Gradient copiedGradient = new Gradient(); 166 | copiedGradient.SetKeys(originalGradient.colorKeys, originalGradient.alphaKeys); 167 | return copiedGradient; 168 | } 169 | else 170 | { 171 | object copied; 172 | try 173 | { 174 | copied = Activator.CreateInstance(original.GetType()); 175 | } 176 | catch (MissingMethodException) 177 | { 178 | copied = FormatterServices.GetUninitializedObject(type); 179 | } 180 | 181 | FieldInfo[] fields = 182 | type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); 183 | foreach (FieldInfo field in fields) 184 | { 185 | object fieldValue = field.GetValue(original); 186 | if (fieldValue == null) 187 | continue; 188 | field.SetValue(copied, CopyValue(fieldValue)); 189 | } 190 | 191 | return copied; 192 | } 193 | } 194 | catch (Exception e) 195 | { 196 | Debug.LogError("Error while copying value: " + e); 197 | return null; 198 | } 199 | } 200 | 201 | #endregion 202 | } 203 | } -------------------------------------------------------------------------------- /Editor/ScriptableObjectCopyPasteHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2848e79024274914ea50bf6ecd6f13d5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/ScriptableObjectCopyPasteWindow.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Reflection; 4 | using UnityEditor; 5 | using UnityEngine; 6 | using Object = UnityEngine.Object; 7 | 8 | namespace RuceSocial.ScriptableObjectFieldCopier 9 | { 10 | public class ScriptableObjectCopyPasteWindow : EditorWindow 11 | { 12 | private Object selectedObject; 13 | private Object lastSelectedObject; 14 | private string searchString = ""; 15 | 16 | private Vector2 scrollPos; 17 | private Dictionary fieldInfoList = new Dictionary(); 18 | 19 | private static ScriptableObjectCopyPasteWindow instance; 20 | private int EligibleObjectCount => ScriptableObjectCopyPasteHandler.GetEligibleObjects(selectedObject).Count; 21 | 22 | public static void OpenWindow(Object selectedObject) 23 | { 24 | if (instance == null) 25 | { 26 | instance = GetWindow("Field List"); 27 | instance.minSize = new Vector2(400, 300); 28 | } 29 | 30 | instance.selectedObject = selectedObject; 31 | instance.ListFields(); 32 | instance.Show(); 33 | } 34 | 35 | [MenuItem("Tools/ScriptableObject Field Copier")] 36 | public static void OpenWindow() 37 | { 38 | OpenWindow(Selection.activeObject is ScriptableObject ? Selection.activeObject : null); 39 | } 40 | 41 | private void OnEnable() 42 | { 43 | ListFields(); 44 | } 45 | 46 | private void OnGUI() 47 | { 48 | GUILayout.Label("Selected Object", EditorStyles.boldLabel); 49 | 50 | EditorGUILayout.BeginHorizontal(); 51 | selectedObject = EditorGUILayout.ObjectField(selectedObject, typeof(ScriptableObject), true); 52 | 53 | // Add a refresh button next to the selectedObject field 54 | if (GUILayout.Button(EditorGUIUtility.IconContent("d_RotateTool"), GUILayout.Width(30), 55 | GUILayout.Height(20))) 56 | { 57 | ListFields(); 58 | } 59 | 60 | EditorGUILayout.EndHorizontal(); 61 | 62 | if (selectedObject == null) 63 | { 64 | EditorGUILayout.HelpBox("Selected Object is null. Please select an object.", MessageType.Warning); 65 | return; 66 | } 67 | 68 | EditorGUILayout.Space(10); 69 | GUILayout.Label("Search Fields", EditorStyles.boldLabel); 70 | string newSearchString = EditorGUILayout.TextField(searchString); 71 | 72 | if (!string.Equals(newSearchString, searchString)) 73 | { 74 | searchString = newSearchString; 75 | ListFields(); // refresh the field list when the search string changes 76 | } 77 | 78 | GUILayout.Label($"Eligible Objects: {EligibleObjectCount}"); 79 | 80 | if (GUILayout.Button("Paste Selected Fields")) 81 | { 82 | Paste(); 83 | } 84 | 85 | EditorGUILayout.Space(20); 86 | 87 | scrollPos = EditorGUILayout.BeginScrollView(scrollPos); 88 | 89 | GUIStyle labelStyle = EditorStyles.label; 90 | GUIStyle toggleStyle = EditorStyles.toggle; 91 | GUIStyle backgroundStyle = GUI.skin.box; 92 | 93 | foreach (var fieldInfo in fieldInfoList.Keys.ToArray()) 94 | { 95 | // filter fields based on the search string 96 | if (fieldInfo.Name.ToLower().Contains(searchString.ToLower())) 97 | { 98 | EditorGUILayout.BeginHorizontal(backgroundStyle); 99 | 100 | fieldInfoList[fieldInfo] = 101 | EditorGUILayout.Toggle(fieldInfoList[fieldInfo], toggleStyle, GUILayout.Width(20)); 102 | EditorGUILayout.LabelField($"{fieldInfo.Name}:", labelStyle); 103 | EditorGUILayout.LabelField(fieldInfo.GetValue(selectedObject)?.ToString() ?? "null", labelStyle); 104 | 105 | EditorGUILayout.EndHorizontal(); 106 | } 107 | } 108 | 109 | EditorGUILayout.EndScrollView(); 110 | 111 | EditorGUILayout.Space(10); 112 | 113 | UpdateSelectedObjectAndListFields(); 114 | } 115 | 116 | private void UpdateSelectedObjectAndListFields() 117 | { 118 | if (selectedObject != lastSelectedObject) 119 | { 120 | if (selectedObject == null) 121 | return; 122 | 123 | ListFields(); 124 | lastSelectedObject = selectedObject; 125 | } 126 | } 127 | 128 | private void ListFields() 129 | { 130 | if (selectedObject == null) 131 | { 132 | return; 133 | } 134 | 135 | // Remember the current toggle status of the fields before clearing the list 136 | var oldFieldInfoList = new Dictionary(fieldInfoList); 137 | fieldInfoList.Clear(); 138 | 139 | FieldInfo[] fields = selectedObject.GetType() 140 | .GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) 141 | .Where(f => f.GetCustomAttributes(typeof(SerializeField), true).Length > 0 || f.IsPublic) 142 | .ToArray(); 143 | 144 | foreach (var field in fields) 145 | { 146 | bool toggleStatus = !oldFieldInfoList.TryGetValue(field, out var value) || value; 147 | fieldInfoList.Add(field, toggleStatus); 148 | } 149 | } 150 | 151 | 152 | private void Paste() 153 | { 154 | ScriptableObjectCopyPasteHandler.PasteSelectedValues(selectedObject, fieldInfoList); 155 | } 156 | } 157 | } -------------------------------------------------------------------------------- /Editor/ScriptableObjectCopyPasteWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e07e0c14dd42e2f43aa99efc30422516 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 rucesocial 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8d229e30c74ebc4a98b283caaba5633 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🌟Scriptable Object Field Copier 🌟 2 | 3 | "Scriptable Ojbect Field Copier" is a time-saving tool for Unity, allowing swift and precise copying of ScriptableObject data. It supports selective field copying, batch pasting, and even works with private fields marked with [SerializeField]. With Undo History integration and a user-friendly interface, it's an essential asset for efficient Unity project management. 4 | ![Main Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGI3R_7pYjfLbtTR_vsa1ekFGnQz-SG0vhR3KKBC0GEDmBgsFRbEPFv-1EjwyTXPh3CGNJ44ptzlQtoiPId6oMOE8uDKI405jwu_A6MscD86ixIzfK1g02kq2KN3rZDuEhtzLijay1jwOkrZk6klyhjAwg4Y4QO4oo7exJmgDgnwZzFaDnKzR6Yup9BWc/s1920/scriptableobjectfieldcopier1_1.jpg) 5 | [![Video Name](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgALovBSK9J5ojOAH_yQPDAfKIEfINvVvTu2SdBVwlGXp-mC8XMcFePs_HVHHoR33kd_0c1XsfjDkkq82Ido882Lv1ZDUT59Kz_wEWh2qq1ARNumCBh2nTmoj0gksJob-7zhx1YusePUnuK732_G6dkGUFsapHYGEFVDomoqb8P9dsYmgnzrTuhDGh-65g/s1920/Ye%C5%9Fil%20Dekoratif%20Cilt%20Bak%C4%B1m%C4%B1%20%C3%9Cr%C3%BCn%20Tan%C4%B1t%C4%B1m%20Instagram%20G%C3%B6nderisi%20(Video).png)](https://youtu.be/D5oiuVO0FjU) 6 | ## Features 7 | - ➡Field Filtering - You can quickly select the fields you want to change by filtering and ensure only they are modified 8 | - 🔒Private Field Support - Even if the fields are private, they're supported if the [SerializeField] attribute has been used. 9 | - 🕓 Save Time - Paste to multiple objects simultaneously, skipping the hassle of handling each one individually. 10 | - ↩️ Undo Ready - All operations can be easily undone from the Unity's Undo History. Safety and convenience at your fingertips! 11 | - 👌 User-Friendly - Our tool comes with a well-structured Editor Window, making it easy to select and modify fields. Search functionality and eligibility check are in place to ensure a smooth workflow. 12 | 13 | ![Image 2](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq4YWs5kAuCdjh4KoUOYtNdPy6Uwr4lWYUuUzEMTrEztR1dIg-hGzQs7L7Xy9o-ajYUNwQ8WaROEi_0t36NWz5GDYLVtylRtFq4T1gsNB0xymwSuXvJZ7N8TiWrw2mywCF77Ef-uJwnhc35R0KlkIVpr0M0OoVqCVOInG62M3umtC9x3N5dyh3KjOlHFA/s1920/scriptableobjectfieldcopier_2.jpg) 14 | ![Image 3](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNH6yHBYBvAwormI621HH0mZYLHBA2KJ2Dxo5jRBTpwx5DtedS8G-MmvS36nTkm0fslhdCe9lpKLWqh6rXp-2zrwxthwHB2vzxhL6ibQBI1MVTjDvDbc4DEDrKNgRlQHLeJ5vuCzWhYYjQITkQ0o7pBoQT0Re9JuILSCsyO3mA9sbF-SM4cDEtEby7dt4/s1920/scriptableobjectfieldcopier_4.jpg) 15 | ![Image 4](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB4U-g7h2kevL8EmnJuhljyGdspkITmprzf8Pfm7KGLlvo4ikd7ddBKFjnkCiU5Vp3y3y339XfG6TUP-5u9hRJ_Il9idSi57X59nFqsiEN1g4ztBEkgqaEFImwit9ZjkLHkhLs16RHD1uZpIy33YOB1KAAu7DOBkEOHwe_7e5AiV4ElD1DFTMO5uitXfg/s1920/scriptableobjectfieldcopier_3.jpg) 16 | ![Image 5](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHD5NHYBluAuXTOVOzcJwt7hISoJHKHXesMhcgMlpML7QBwaOsVI8oo9QjebKBegR9dmXBqrZBW6BgrojzqXNu_n2U-iIkkSa6AZP-tdBERiukT85fsD5jFece0ocaNUfOz1WqOwxzwxKuw02ZaSu1JYs6Xk5faC_1nRDKBP_h5FP9V2f92dKe5Oug4uI/s1920/scriptableobjectfieldcopier_5.jpg) 17 | 18 | ## How to Use? 19 | Right-click on the ScriptableObject whose data you want to copy and select "Copy ScriptableObject." 20 | Then, select the ScriptableObjects where you want to paste the data. Right-click again and choose "Paste ScriptableObject." 21 | In the window that appears, make the necessary filters and click on the "Paste" button to proceed. 22 | Also, you can access the editor window through the Unity menu by navigating to Tools -> ScriptableObject Field Copier. 23 | 24 | 🚀 Elevate your Unity project with Scriptable Object Field Copier and accelerate your game development process! 🎮 25 | 26 | 27 | Tested variable types; 28 | 29 | ``` 30 | int 31 | bool 32 | float 33 | string 34 | CustomClass 35 | UnityEngine.Object 36 | Sprite 37 | Mesh 38 | Texture2D 39 | UnityEngine.Object[] 40 | List 41 | List 42 | AnimationCurve 43 | Gradient 44 | AssetReference 45 | privateString (private field) 46 | ReadOnlyClass (read-only field) 47 | NestedClass (nested class) 48 | CustomClassWithoutDefaultConstructor 49 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87500ba8d2a6546459f7a61d7d949039 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /RuceSocial.ScriptableObjectFieldCopier.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RuceSocial.ScriptableObjectFieldCopier", 3 | "rootNamespace": "", 4 | "references": [], 5 | "includePlatforms": [ 6 | "Editor" 7 | ], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /RuceSocial.ScriptableObjectFieldCopier.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a667ec6f4a6b5c4eb4db14bae1c806e 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.rucesocial.scriptableobjectfieldcopier", 3 | "displayName": "Scriptable Object Field Copier", 4 | "version": "1.1.2", 5 | "unity": "2021.1", 6 | "description": "A Unity tool that allows you to effortlessly copy fields from one ScriptableObject and paste into the fields of your chosen ScriptableObjects, with added functionality to filter through fields.", 7 | "keywords": ["unity", "copy", "paste", "fields", "scriptableobject"], 8 | "category": "Editor Tools", 9 | "author": { 10 | "name": "Ruce Social", 11 | "email": "rucesocial@gmail.com", 12 | "url": "https://rucesocial.com" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/RuceSocial/ScriptableObjectFieldCopier.git" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3316bcefb52b5064ea46e2af540e3b85 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------