-
Notifications
You must be signed in to change notification settings - Fork 0
/
Extensions.cs
53 lines (50 loc) · 1.33 KB
/
Extensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Assets.Scripts.Models;
using Il2CppSystem.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnhollowerBaseLib;
using UnityEngine;
namespace QuinceMod
{
static class Extensions
{
public static Il2CppReferenceArray<T> Add<T>(this Il2CppReferenceArray<T> reference, T newPart) where T : Model
{
List<T> list = new List<T>();
foreach (T item in reference)
{
list.Add(item);
}
list.Add(newPart);
return new Il2CppReferenceArray<T>(list.ToArray());
}
public static Il2CppReferenceArray<T> Add<T>(this Il2CppReferenceArray<T> reference, List<T> newPart) where T : Model
{
List<T> list = new List<T>();
foreach (T item in reference)
{
list.Add(item);
}
foreach (T item2 in newPart)
{
list.Add(item2);
}
return new Il2CppReferenceArray<T>(list.ToArray());
}
//public static Transform FindDeepChild(this Transform aParent, string aName)
//{
// System.Collections.Generic.Queue<Transform> queue = new System.Collections.Generic.Queue<Transform>();
// queue.Enqueue(aParent);
// while (queue.Count > 0)
// {
// var c = queue.Dequeue();
// if (c.name == aName)
// return c;
// foreach (Transform t in c)
// queue.Enqueue(t);
// }
// return null;
//}
}
}