//Get Variable based on origin and variable type private object GetVar(VariableHandler handler, GameVariableType variableType) { switch (variableType) { case GameVariableType.Bool: return(handler.GetBool(key.GetValue())); case GameVariableType.Float: return(handler.GetFloat(key.GetValue())); default: return(handler.GetString(key.GetValue())); } }