diff --git a/Runtime/Extensions/EnumerableExtensions.cs b/Runtime/Extensions/EnumerableExtensions.cs new file mode 100644 index 0000000..803ddc0 --- /dev/null +++ b/Runtime/Extensions/EnumerableExtensions.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace OmegaLeo.Toolbox.Runtime.Extensions +{ + public static class EnumerableExtensions + { + public static IEnumerable Copy(this IEnumerable array) where T : ScriptableObject + { + foreach (var obj in array) + { + yield return obj.Copy(); + } + } + } +} \ No newline at end of file diff --git a/Runtime/Extensions/EnumerableExtensions.cs.meta b/Runtime/Extensions/EnumerableExtensions.cs.meta new file mode 100644 index 0000000..90ba489 --- /dev/null +++ b/Runtime/Extensions/EnumerableExtensions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 925be84610bc4ad8b9e84953c1af9a1c +timeCreated: 1701289644 \ No newline at end of file diff --git a/Runtime/Extensions/IListExtensions.cs b/Runtime/Extensions/IListExtensions.cs index 3be8cfc..f3a38e6 100644 --- a/Runtime/Extensions/IListExtensions.cs +++ b/Runtime/Extensions/IListExtensions.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; +using UnityEngine; +using Random = System.Random; namespace OmegaLeo.Toolbox.Runtime.Extensions { diff --git a/Runtime/Extensions/ScriptableObjectExtensions.cs b/Runtime/Extensions/ScriptableObjectExtensions.cs index c27bdad..cdad071 100644 --- a/Runtime/Extensions/ScriptableObjectExtensions.cs +++ b/Runtime/Extensions/ScriptableObjectExtensions.cs @@ -7,7 +7,7 @@ public static class ScriptableObjectExtensions /// /// Creates and returns a clone of any given scriptable object. /// - public static T Clone(this T scriptableObject) where T : ScriptableObject + public static T Copy(this T scriptableObject) where T : ScriptableObject { if (scriptableObject == null) {