Created
July 30, 2018 13:20
-
-
Save jmickle66666666/161c7ea0d6e13c9cdba7fd3d3a89d344 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MethodInfo method = thisType.GetMethod(curLine[0]); | |
if (method != null) { | |
ParameterInfo[] parameters = method.GetParameters(); | |
if (parameters.Length == curLine.Length-1) { | |
object[] inputParameters = new object[parameters.Length]; | |
for (int i = 0; i < parameters.Length; i++) { | |
if (parameters[i].ParameterType.Equals(typeof(int))) { | |
inputParameters[i] = ReadVar(curLine[i+1]); | |
} else if (parameters[i].ParameterType.Equals(typeof(Vector2Int))) { | |
inputParameters[i] = ReadPos(curLine[i+1]); | |
} else if (parameters[i].ParameterType.Equals(typeof(float))) { | |
inputParameters[i] = ReadFloat(curLine[i+1]); | |
} | |
} | |
method.Invoke(this, inputParameters); | |
} else { | |
Warning("Incorrect number of parameters. Expected "+parameters.Length.ToString()+" got "+(curLine.Length-1).ToString()); | |
} | |
} else { | |
Warning("Couldn't find function: "+curLine[0]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment