Method CreateGameObject
CreateGameObject(GameObject, string, params Type[])
Create a game object
Declaration
public static GameObject CreateGameObject(GameObject parent, string name, params Type[] types)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | parent | The parent |
| string | name | The wanted name (can be updated with a number if a sibling with same name exist |
| Type[] | types | Required component on this object in addition to Transform |
Returns
| Type | Description |
|---|---|
| GameObject | The created object |
CreateGameObject(string, Object)
Creates a new GameObject and set it's position to the current view
Declaration
public static GameObject CreateGameObject(string name, Object context)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | the name of the new gameobject |
| Object | context | the parent of the gameobject |
Returns
| Type | Description |
|---|---|
| GameObject | the created GameObject |