AddComponent

AddComponent(GameObject, Type)

public static Component AddComponent(GameObject gameObject, Type type) ;

Description

Add component.

Parameters

Parameter Name Description
gameObject GameObject
type Component type

Returns

Component

AddComponent<Type>(GameObject)

public static Type AddComponent<Type>(GameObject gameObject) ;

Description

Add component.

Type Parameters

Type Parameter Name Description Type Constraints
Type Component type
  • Component

Parameters

Parameter Name Description
gameObject GameObject

Returns

Component