GameObjectExtension.SetLayerRecursively C# (CSharp) 메소드

SetLayerRecursively() 공개 정적인 메소드

public static SetLayerRecursively ( GameObject gameObject, int layer ) : void
gameObject GameObject
layer int
리턴 void
    public static void SetLayerRecursively(this GameObject gameObject, int layer)
    {
        gameObject.layer = layer;
        foreach (Transform child in gameObject.transform)
        {
            child.gameObject.SetLayerRecursively(layer);
        }
    }
}
GameObjectExtension