-
Notifications
You must be signed in to change notification settings - Fork 4
/
Helper.cs
38 lines (30 loc) · 843 Bytes
/
Helper.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
using UnityEngine;
using System.Collections;
namespace Hard{
public static class Helper{
public static GameObject ChildNamed(GameObject o, string n) {
Transform[] ts = o.transform.GetComponentsInChildren<Transform>(true);
foreach (Transform t in ts) if (t.gameObject.name == n) return t.gameObject;
return null;
}
public static int Mod(int a, int b){
return a % b;
}
public static Vector3 Aget(Vector3[] coll, int i)
{
return coll[i];
}
public static Quaternion Aget(Quaternion[] coll, int i)
{
return coll[i];
}
public static int Layer(int i)
{
return 1 << i;
}
public static AnimationState GetAnimationState(Animation animation, string s)
{
return animation[s];
}
}
}