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));
     }
 }
Пример #2
0
    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);
        }
    }
Пример #3
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);
        }
    }