UnityEngine.GameObject.AddComponent C# (CSharp) Method

AddComponent() public method

public AddComponent ( Type componentType ) : Component
componentType System.Type
return Component
		public Component AddComponent(Type componentType){}
		private Component Internal_AddComponentWithType(Type componentType){}

Same methods

GameObject::AddComponent ( string className ) : Component
GameObject::AddComponent ( ) : T

Usage Example

コード例 #1
0
	static void AddHeatMap ()
	{
		GameObject go = new GameObject("GA_HeatMap");
		go.AddComponent<GA_HeatMapRenderer>();
		go.AddComponent<GA_HeatMapDataFilter>();
		Selection.activeObject = go;
	}
All Usage Examples Of UnityEngine.GameObject::AddComponent