Exemplo n.º 1
0
    public void Execute(MonoBehaviour mb, Type componentType, Action <MonoBehaviour, object> SetVariableType)
    {
        GameObject go = mb.gameObject;

        if (componentType.IsArray || Rhm.IsList(componentType))
        {
            MultipleComponentAssignment(mb, go, componentType, SetVariableType);
        }
        else
        {
            SetVariableType(mb, GetTheSingleComponent(mb, componentType));
        }
    }
Exemplo n.º 2
0
    public bool Execute(MonoBehaviour mb, Type componentType, Action <MonoBehaviour, object> setVariable)
    {
        GameObject go = mb.gameObject;

        if (componentType.IsArray)
        {
            return(AssignArray(mb, go, componentType, setVariable));
        }
        else if (
            Rhm.IsList(componentType))
        {
            // Can't handle lists without using dynamic keyword.
            // Arrays will have to be enough.
            return(false);
        }
        else
        {
            setVariable(mb, GetTheSingleComponent(mb, componentType));
            return(true);
        }
    }