Click or drag to resize

ScriptProxy Class

A ScriptProxy acts as a wrapper for a type instance and allows non-concrete communication if the type is unknown at compile time.
Inheritance Hierarchy
SystemObject
  UMod.ScriptingScriptProxy

Namespace:  UMod.Scripting
Assembly:  UMod (in UMod.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class ScriptProxy : IDisposable

The ScriptProxy type exposes the following members.

Properties
  NameDescription
Public propertyBehaviourInstance
Get the instance of the script as a MonoBehaviour. This property will return null if the wrapped type does not inherit from MonoBehaviour.
Public propertyFields
Returns the IScriptMemberProxy that provides access to the fields of the wrapped type.
Public propertyInstance
Get the instance of the script as an object. Use this property to access the managed instance.
Public propertyIsDisposed
Returns true if the proxy has been disposed. Be careful, the proxy can become disposed automatically if the managed type is destroyed by Unity. This can occur during scene changes for MonoBehaviour components and cause the proxy to become invalid. If you want to make sure the wrapped type is not dispoed automatically then you can call MakePersistent.
Public propertyIsMonoBehaviour
Returns true if the managed type inherits from MonoBehaviour. This is equivilent of calling IsMonoBehaviour.
Public propertyIsScriptableObject
Returns true if the managed type inherits from ScriptableObject. This is equivilent of calling IsScriptableObject.
Public propertyIsUnityObject
Returns true if the ScriptType inherits from Object. If this value is true then it is safe to cast this proxy into a ScriptProxy for Unity specific operations.
Public propertyProperties
Returns the IScriptMemberProxy that provides access to the properties of the wrapped type.
Public propertySafeFields
Public propertySafeProperties
Public propertyScriptableInstance
Get the instance of the script as a ScriptableObject. This property will return null if the wrapped type does not inherit from ScriptableObject.
Public propertyScriptType
Get the ScriptType of this proxy object.
Public propertyUnityInstance
Access the wrapped instance as a unity Object.
Top
Methods
  NameDescription
Public methodCall(String)
Attempt to call a method on the managed type with the specified name. This works in a similar way as SendMessage(String) where the method name is specified. The target method must not accept any arguments.
Public methodCall(String, Object)
Attempt to call a method on the managed type with the specified name and arguments. This works in a similar was as SendMessage(String) where the method name is specified. Any number of arguments may be specified but the target method must expect the arguments.
Public methodCall(String, ProxyCallConvention)
Attempt to call a method on the managed instance with the specified name. This works in a similar way as SendMessage(String) where the method name is specified. The target method must not accept any arguments.
Public methodCall(String, ProxyCallConvention, Object)
Attempt to call a method on the managed instance with the specified name and arguments. This works in a similar was as SendMessage(String) where the method name is specified. Any number of arguments may be specified but the target method must expect the arguments.
Public methodDispose
Dispose of the proxy and its managed script instance. Once disposed, the proxy should never be accessed again. Only call this method once you are sure you will never need the instance again.
Public methodGetInstanceAsT
Attempts to get the managed instance as the specified generic type.
Public methodGetInstanceType
Get the system type of the managed script type.
Public methodMakePersistent
If the managed object is a Unity type then this method will call 'DontDestroyOnLoad' to ensure that the object is able to survie scene loads.
Public methodSafeCall(String)
Attempt to call a method on the managed type with the specified name. Any exceptions thrown as a result of location or calling the method will be caught silently. This works in a similar was as SendMessage(String) where the target method name is specified. The target method must not accept any arguments.
Public methodSafeCall(String, Object)
Attempt to call a method on the managed type with the specified name. Any exceptions thrown as a result of location or calling the method will be caught silently. This works in a similar was as SendMessage(String) where the target method name is specified. Any number of arguments may be specified but the target method must expect the arguments.
Public methodSafeCall(String, ProxyCallConvention)
Attempt to call a method on the managed instance with the specified name. Any exceptions thrown as a result of locating or calling the method will be caught silently. This works in a similar was as SendMessage(String) where the target method name is specified. The target method must not accept any arguments.
Public methodSafeCall(String, ProxyCallConvention, Object)
Attempt to call a method on the managed instance with the specified name. Any exceptions thrown as a result of locating or calling the method will be caught silently. This works in a similar was as SendMessage(String) where the target method name is specified. Any number of arguments may be specified but the target method must expect the arguments.
Top
See Also