|
◆ AddComponent< TComponent >()
static TComponent Sisus.Init.Reflection.GameObjectExtensions.AddComponent< TComponent > |
( |
this GameObject |
gameObject, |
|
|
params(string name, object value)[] |
arguments |
|
) |
| |
|
static |
Adds a component of type TComponent to the gameObject and initializes the component using the provided arguments .
- Template Parameters
-
TComponent | Type of the component to add. |
- Parameters
-
gameObject | The GameObject to which the component is added. |
arguments | Zero or more values to set. |
- Returns
- The added component.
- Exceptions
-
ArgumentNullException | Thrown if this GameObject is null . |
MissingMemberException | Thrown if no field or property with one of the provided name names was found on the client class TComponent , or if a field or property was found but a value of type TValue is not assignable to it. |
|