Skip to content

Commit

Permalink
Add AddRange
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonic853 committed Sep 11, 2024
1 parent 2981e0b commit 8d4d5b6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Scripts/UdonArrayPlus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,24 @@ public static T[] Remove<T>(ref T[] _array, T _value)
{
return _array = Remove(_array, _value);
}
public static T[] AddRange<T>(T[] _array, T[] collection)
{
var length = _array.Length;

var collectionLength = collection.Length;

var newArray = new T[length + collectionLength];

_array.CopyTo(newArray, 0);

collection.CopyTo(newArray, length);

return newArray;
}
public static T[] AddRange<T>(ref T[] _array, T[] collection)
{
return _array = AddRange(_array, collection);
}
// String
public static string[] StringsFindLikeAll(string[] _array, string _value)
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.sonic853.udonlab.arrayplus",
"version": "1.0.3",
"version": "1.0.4",
"displayName": "Udon Lab - Udon Array Plus",
"description": "The Udon Lab",
"unity": "2022.3",
Expand Down

0 comments on commit 8d4d5b6

Please sign in to comment.