public WeenusUI(Component unityComponent) { var buttons = new List <WeenusFieldButton>(); var views = new List <WeenusFieldView>(); var inputs = new List <WeenusInputField>(); RectTransform rect = unityComponent.GetComponent <RectTransform>(); GameObjectUtilities.GetAllComponentsInChildTree <WeenusFieldButton>(rect, buttons); GameObjectUtilities.GetAllComponentsInChildTree <WeenusFieldView>(rect, views); GameObjectUtilities.GetAllComponentsInChildTree <WeenusInputField>(rect, inputs); foreach (var b in buttons) { Button.Add(b.gameObject.name, b); } foreach (var b in views) { FieldView.Add(b.gameObject.name, b); } foreach (var b in inputs) { FieldInput.Add(b.gameObject.name, b); } }