Skip to content

Commit 7c2f4d8

Browse files
committed
new game object factory util
1 parent e2a0664 commit 7c2f4d8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

platform/fGameObjectFactory.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ public static fGameObject CreateParentGO(string sName)
2323
}
2424

2525

26+
public static T CreateParentTypeGO<T>(string sName)
27+
where T : fGameObject, new()
28+
{
29+
GameObject go = new GameObject(sName);
30+
T fgo = new T();
31+
fgo.Initialize(go, FGOFlags.NoFlags);
32+
return fgo;
33+
}
34+
35+
2636
public static fGameObject CreateTrackingGO(string sName, fGameObject trackGO)
2737
{
2838
GameObject go = new GameObject(sName);

0 commit comments

Comments
 (0)