-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMonoConstructor.cs
49 lines (44 loc) · 2.09 KB
/
MonoConstructor.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
using UnityEngine;
namespace MonoConstruct
{
public static class MonoConstructor
{
public static MonoConstructable<T1> Instantiate<T1>(this MonoConstructable<T1> monoConstructable, T1 arg1,
Transform transform = null)
{
MonoConstructArgs<T1>.SetArgs(arg1);
var newGameObject = Object.Instantiate(monoConstructable, transform);
return newGameObject;
}
public static MonoConstructable<T1, T2> Instantiate<T1, T2>(this MonoConstructable<T1, T2> monoConstructable,
T1 arg1, T2 arg2, Transform transform = null)
{
MonoConstructArgs<T1, T2>.SetArgs(arg1, arg2);
var newGameObject = Object.Instantiate(monoConstructable, transform);
return newGameObject;
}
public static MonoConstructable<T1, T2, T3> Instantiate<T1, T2, T3>(
this MonoConstructable<T1, T2, T3> monoConstructable, T1 arg1, T2 arg2, T3 arg3, Transform transform = null)
{
MonoConstructArgs<T1, T2, T3>.SetArgs(arg1, arg2, arg3);
var newGameObject = Object.Instantiate(monoConstructable, transform);
return newGameObject;
}
public static MonoConstructable<T1, T2, T3, T4> Instantiate<T1, T2, T3, T4>(
this MonoConstructable<T1, T2, T3, T4> monoConstructable, T1 arg1, T2 arg2, T3 arg3, T4 arg4,
Transform transform = null)
{
MonoConstructArgs<T1, T2, T3, T4>.SetArgs(arg1, arg2, arg3, arg4);
var newGameObject = Object.Instantiate(monoConstructable, transform);
return newGameObject;
}
public static MonoConstructable<T1, T2, T3, T4, T5> Instantiate<T1, T2, T3, T4, T5>(
this MonoConstructable<T1, T2, T3, T4, T5> monoConstructable, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5,
Transform transform = null)
{
MonoConstructArgs<T1, T2, T3, T4, T5>.SetArgs(arg1, arg2, arg3, arg4, arg5);
var newGameObject = Object.Instantiate(monoConstructable, transform);
return newGameObject;
}
}
}