コード例 #1
0
    private object getActionVar()
    {
        DynamicAction action = LegacyEditorData.instance.currentAction;

        if (varSource == DataInputVarSource.FIELD)
        {
            object actionVar = action.GetType().GetField(varName).GetValue(action);
            if (actionVar != null)
            {
                switch (varType)
                {
                case VarType.BOOL:
                    return((bool)actionVar);

                case VarType.INT:
                    return((int)actionVar);

                case VarType.FLOAT:
                    return((float)actionVar);

                default:
                    return((string)actionVar);
                }
            }
            else
            {
                Debug.LogWarning("Action " + action.name + " has null value for var: " + varName);
                return("");
            }
        }
        return("");
    }
コード例 #2
0
    private bool getActionVar()
    {
        DynamicAction action = LegacyEditorData.instance.currentAction;

        if (action.name != "")
        {
            if (varSource == ActionVarType.FIELD)
            {
                return((bool)action.GetType().GetField(varName).GetValue(action));
            }
        }
        //else
        //{
        //return action.GetVar(varName);
        //}
        return(false);
    }
コード例 #3
0
    private void setActionVar(object valueToSet)
    {
        DynamicAction action = LegacyEditorData.instance.currentAction;

        action.GetType().GetField(actionVar).SetValue(action, valueToSet);
    }
コード例 #4
0
    private object getActionVar()
    {
        DynamicAction action = LegacyEditorData.instance.currentAction;

        return(action.GetType().GetField(actionVar).GetValue(action));
    }