private Component FindComponent(string from, bool inherit, Type componentType) { if (string.IsNullOrEmpty(from)) { return(CurrentComponent.GetComponent(componentType, inherit)); } else { return(Entity.Find(from)?.GetComponent(componentType, inherit)); } }
int GetSlotState(Transform slot) { Transform CurrentComponent; if (slot.transform.childCount != 0) { CurrentComponent = slot.transform.GetChild(0); //Grabs the first child (which should be the only child) return(CurrentComponent.GetComponent <ComponentBehavior>().State); } else { return(0); } }
int[] GetSlotAttributes(Transform slot) { Transform CurrentComponent; if (slot.transform.childCount != 0) { CurrentComponent = slot.transform.GetChild(0); //Grabs the first child (which should be the only child) return(CurrentComponent.GetComponent <ComponentBehavior>().Attributes); } else { return(null); } }