UnityEngine.GameObject.GetComponents C# (CSharp) Method

GetComponents() public method

public GetComponents ( ) : T[]
return T[]
		public T[] GetComponents(){}
		public Component[] GetComponentsInChildren(Type type){}

Same methods

GameObject::GetComponents ( Type type ) : UnityEngine.Component[]

Usage Example

Example #1
0
    void enablePlayer(GameObject player)
    {
        foreach (MonoBehaviour obj in player.GetComponents<MonoBehaviour>())
            obj.enabled = true;

        foreach (CharacterController obj in player.GetComponents<CharacterController>())
            obj.enabled = true;
    }
All Usage Examples Of UnityEngine.GameObject::GetComponents