Q:

(Unity)How to pass variables, that are variable without a bunch of If Else Statements

for (int m = 0; m < materialObjects.Length; m++)
            {
                for (int i = 0; i < materialModifiers.Count; i++)
                {
                    if(materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Float)
                    {
                        if (materialModifiers[i].valueFloat[0] != materialModifiers[i].oldValueFloat[0])
                        {
                            materialObjects[m].material.SetFloat(materialModifiers[i].identifier, materialModifiers[i].valueFloat[0]);
                            materialModifiers[i].valueFloat = materialModifiers[i].oldValueFloat;
                        }

                    }
                    else if (materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Float2 || materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Float3 || materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Float4)
                    {
                        if (materialModifiers[i].valueFloat != materialModifiers[i].oldValueFloat)
                        {
                            materialObjects[m].material.SetFloatArray(materialModifiers[i].identifier, materialModifiers[i].valueFloat);
                            materialModifiers[i].valueFloat = materialModifiers[i].oldValueFloat;
                        }
                    }                   
                    else if (materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Int)
                    {
                        if (materialModifiers[i].valueInt != materialModifiers[i].oldValueInt)
                        {
                            materialObjects[m].material.SetInt(materialModifiers[i].identifier, materialModifiers[i].valueInt[0]);
                            materialModifiers[i].valueFloat = materialModifiers[i].oldValueFloat;
                        }
                    }
                    else if (materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Int2 || materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Int3 || materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Int4)
                    {

                    }
                    else if (materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Bool)
                    {

                    }
                    else if (materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.ColorField)
                    {

                    }
                    else if (materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Vector2)
                    {

                    }
                    else if (materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Vector3)
                    {

                    }
                    else if (materialModifiers[i].valueType == LittleSubstanceModifier.ValueType.Vector4)
                    {

                    }
                }
            }

I'm making a tool right now, and the user is able to pick a variable type that the user can edit in the inspector window. 
To pick the variable I'm using an Enum, but then to check which type of variable they chose, I'm using a bunch of Else Ifs. Now to pick the variable, its ok doing it with Else If, but when it comes time to changing the value I can't be doing 10 else ifs every time they add a letter, or change a number.
So my question, how can I pass the variable type that is selected, without finding out what they chose without a bunch of else ifs? It would be nice if I could use var, but it is being changed from another script.
Sorry for the long sloppy post, I really don't know what to call this and how to ask.
Edit: Here is my code, what would be a better way of doing this?
Edit2: Response to Robyn - I just wrote that code for an example, its basically the only way I would know how to do this. Sorry, I will try to explain as best I can. 
In the image I posted, there is the Identifier text box, which has opacity in it.
Then the drop down with all the variable types. Then it has a text box. You hit the button add Mod, and a row of those pops up. You pick either your variable type, put in the materials identifier (example opacity). So to change opacity it needs to be a float. So when you change the float boxes value, it will change the materials opacity.
I basically need a value, that can be used as a float, int, bool, etc...
I've never used Switch or Case, so I don't really know what it does exactly. But I will look it up try! So Thanks. 
I just uploaded 2 more images trying to visually explain it a little better.
Tool
Code

A:

You could use Switch and Foreach statements instead of If and For statements to make that code a little easier to read, to something like this:
foreach (var materialObject in materialObjects)
{
    foreach (var materialModifier in materialModifiers)
    {
        switch (materialModifier.valueType)
        {
            case LittleSubstanceModifier.ValueType.Float:
                if (materialModifier.valueFloat[0] != materialModifier.oldValueFloat[0])
                {
                     materialObject.material.SetFloat(materialModifier.identifier, materialModifier.valueFloat[0]);
                     materialModifier.valueFloat = materialModifier.oldValueFloat;
                }
                break;
            case LittleSubstanceModifier.ValueType.Float2:
            case LittleSubstanceModifier.ValueType.Float3:
            case LittleSubstanceModifier.ValueType.Float4:
                if (materialModifier.valueFloat != materialModifier.oldValueFloat)
                {
                    materialObject.material.SetFloatArray(materialModifier.identifier, materialModifier.valueFloat);
                    materialModifier.valueFloat = materialModifier.oldValueFloat;
                }
                break;

etc etc
        }
    }
}

(Also your code looks like it might not do exactly what you want... but I haven't changed what it does, because I don't know what you want it to do)

