reflection-method-call
Call C# methods in Unity, including private ones, by providing method schemas and input parameters to execute functionality within the Unity Editor.
Instructions
Call C# method. Any method could be called, even private methods. It requires to receive proper method schema. Use 'reflection-method-find' to find available method before using it. Receives input parameters and returns result.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | Yes | Method filter. SCHEMA: {"namespace":"UnityEngine","typeName":"Application","methodName":"get_dataPath","inputParameters":[]} | |
| knownNamespace | No | Set to true if 'Namespace' is known and full namespace name is specified in the 'filter.Namespace' property. Otherwise, set to false. | false |
| typeNameMatchLevel | No | Minimal match level for 'typeName'. 0 - ignore 'filter.typeName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. | 1 |
| methodNameMatchLevel | No | Minimal match level for 'MethodName'. 0 - ignore 'filter.MethodName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. | 1 |
| parametersMatchLevel | No | Minimal match level for 'Parameters'. 0 - ignore 'filter.Parameters', 1 - parameters count is the same, 2 - equals (default value). | 2 |
| targetObject | No | Specify target object to call method on. Should be null if the method is static or if there is no specific target instance. New instance of the specified class will be created if the method is instance method and the targetObject is null. Required: type - full type name of the object to call method on, value - serialized object value (it will be deserialized to the specified type). Schema: null for static methods, or {"instanceID":int} | |
| inputParameters | No | Method input parameters. Per each parameter specify: type - full type name of the object to call method on, name - parameter name, value - serialized object value (it will be deserialized to the specified type). Schema: [{"typeName":"string","value":any}] | |
| executeInMainThread | No | Set to true if the method should be executed in the main thread. Otherwise, set to false. | true |