UnityEngine.GameObject.GetComponents C# (CSharp) Méthode

GetComponents() public méthode

public GetComponents ( Type type ) : UnityEngine.Component[]
type System.Type
Résultat UnityEngine.Component[]
		public Component[] GetComponents(Type type){}
		public T[] GetComponents(){}

Same methods

GameObject::GetComponents ( ) : T[]

Usage Example

Exemple #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