My Project
|
A ScriptDomain acts as a container for all code that is loaded dynamically at runtime. The main responsiblility of the domin is to separate pre-compiled game code from runtime-loaded code. As a result, you will only be able to access types from the domain that were loaded at runtime. Any pre-compiled game code will be ignored. Any assemblies or scripts that are loaded into the domain at runtime will remain until the application exits so you should be careful to avoid loading too many assemblies. You would typically load user code at statup in a 'Load' method which would then exist and execute until the game exits. Multiple domain instances may be created but you should note that all runtime code will be loaded into the current application domain. The ScriptDomain simply masks the types that are visible. More...
Public Member Functions | |
ScriptAssembly | LoadAssemblyFromResources (string resourcePath, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly from the specified resources path into the sandbox app domain. The target asset must be a TextAsset in order to be loaded successfully. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | LoadAssembly (string fullPath, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load the specified managed assembly into the sandbox app domain. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | LoadAssemblyWithSymbols (string assemblyPath, string symbolsPath, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load the specified managed assembly into the sandbox app domain along with pdb debug symbols. Use this method if you want to be able to debug the specified assembly. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | LoadAssembly (AssemblyName name, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load the specified managed assembly into the sandbox app domain. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | LoadAssembly (byte[] assemblyBytes, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly from the specified raw bytes. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | LoadAssemblyWithSymbols (byte[] assemblyBytes, byte[] symbolBytes, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly from the specified raw bytes along with debug symbols. Use this method if you want to be able to debug the specified assembly. Use SecurityResult to get the output from the code validation request. | |
AsyncLoadOperation | LoadAssemblyAsync (string fullPath, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly from the specified filepath asynchronously. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request. | |
AsyncLoadOperation | LoadAssemblyWithSymbolsAsync (string assemblyPath, string symbolsPath, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly from the specified filepath asynchronously. Use this method if you want to be able to debug the specified assembly. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request. | |
AsyncLoadOperation | LoadAssemblyAsync (AssemblyName name, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly with the specified name asynchronously. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request. | |
AsyncLoadOperation | LoadAssemblyAsync (byte[] assemblyBytes, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly from the specified raw bytes asynchronously. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request. | |
AsyncLoadOperation | LoadAssemblyWithSymbolsAsync (byte[] assemblyBytes, byte[] symbolBytes, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly from the specified raw bytes asynchronously. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request. Use this method if you want to be able to debug the specified assembly. | |
bool | TryLoadAssembly (string fullPath, out ScriptAssembly result, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load the managed assembly at the specified location. Any exceptions throw while loading will be caught. | |
bool | TryLoadAssembly (AssemblyName name, out ScriptAssembly result, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly with the specified name. Any exceptions thrown while loading will be caught. | |
bool | TryLoadAssembly (byte[] data, out ScriptAssembly result, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings) |
Attempts to load a managed assembly from the raw assembly data. Any exceptions thrown while loading will be caught. | |
ScriptType | CompileAndLoadMainSource (string cSharpSource, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the speciied C# source code string. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. This does the same as CompileAndLoadSource(string, ScriptSecurityMode) but returns the main type of the ScriptAssembly for convenience. ///. | |
ScriptType | CompileAndLoadMainFile (string cSharpFile, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source file. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. This does the same as CompileAndLoadFileAsync(string, ScriptSecurityMode) but returns the main type of the ScriptAssembly for convenience. | |
ScriptType | CompileAndLoadMainSyntaxTree (CSharpSyntaxTree syntaxTree, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# syntax tree. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. This does the same as CompileAndLoadSyntaxTree(CSharpSyntaxTree, ScriptSecurityMode, IMetadataReferenceProvider[]) but returns the main type of the ScriptAssembly for convenience. | |
ScriptAssembly | CompileAndLoadSource (string cSharpSource, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source code string. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | CompileAndLoadFile (string cSharpFile, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source file. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | CompileAndLoadDirectory (string directoryPath, string searchPattern="*.cs", SearchOption searchOption=SearchOption.TopDirectoryOnly, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load all C# source files in a given directory. Using the searchPattern and searchOption parameters, you can control whether nested directories are scanned, as well as filter by file name and extension. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | CompileAndLoadSyntaxTree (CSharpSyntaxTree syntaxTree, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# syntax tree. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | CompileAndLoadSources (string[] cSharpSources, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source code strings. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | CompileAndLoadFiles (string[] cSharpFiles, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source files. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | CompileAndLoadSyntaxTrees (CSharpSyntaxTree[] syntaxTrees, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# syntax tree. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | CompileAndLoadCSharpProject (string cSharpProjectFile, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# project file (.csproj). Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
ScriptAssembly | CompileAndLoadCSharpProject (CSharpProject cSharpProject, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# project. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. | |
AsyncCompileOperation | CompileAndLoadSourceAsync (string cSharpSource, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source string asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request. | |
AsyncCompileOperation | CompileAndLoadFileAsync (string cSharpFile, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source file asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request. | |
AsyncCompileOperation | CompileAndLoadSyntaxTreeAsync (CSharpSyntaxTree syntaxTree, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# syntax tree asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request. | |
AsyncCompileOperation | CompileAndLoadSourcesAsync (string[] cSharpSources, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source strings asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request. | |
AsyncCompileOperation | CompileAndLoadFilesAsync (string[] cSharpFiles, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# source files asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request. | |
AsyncCompileOperation | CompileAndLoadSyntaxTreesAsync (CSharpSyntaxTree[] syntaxTrees, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
Compile and load the specified C# syntax trees asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request. | |
void | CompileFromSource (string cSharpSource, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
void | CompileFromSources (string[] cSharpSources, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
void | CompileFromFile (string cSharpFile, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
void | CompileFromFiles (string[] cSharpFiles, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
void | CompileFromSyntaxTree (CSharpSyntaxTree syntaxTree, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
void | CompileFromSyntaxTrees (CSharpSyntaxTree[] syntaxTrees, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
void | CompileFromCSharpProject (string cSharpProjectFile, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
void | CompileFromCSharpProject (CSharpProject project, IMetadataReferenceProvider[] additionalReferenceAssemblies=null) |
void | StaticBroadcast (string methodName) |
Attempt to invoke a static method for all types loaded into this domain. Only static method will be considered by this broadcast. Use Broadcast(Scene, string) or BroadcastInstance(Type, string) to broadcast an instance method. | |
void | StaticBroadcast (string methodName, params object[] args) |
Attempt to invoke a static method for all types loaded into this domain. Only static method will be considered by this broadcast. Use Broadcast(Scene, string, object[]) or BroadcastInstance(Type, string, object[]) to broadcast an instance method. | |
void | BroadcastActiveScene (string methodName) |
Attempt to invoke an instance method for all executing mono bheaivour instances loaded into this domain that exist in the active loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances. | |
void | BroadcastActiveScene (string methodName, params object[] args) |
Attempt to invoke an instance method for all executing mono bheaivour instances loaded into this domain that exist in the active loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. | |
void | BroadcastActiveScene (Type baseType, string methodName) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the active loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered. | |
void | BroadcastActiveScene (Type baseType, string methodName, params object[] args) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the active loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered. | |
void | BroadcastAllScenes (string methodName) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in any loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances. | |
void | BroadcastAllScenes (string methodName, params object[] args) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in any loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. | |
void | BroadcastAllScenes (Type baseType, string methodName) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in any loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered. | |
void | BroadcastAllScenes (Type baseType, string methodName, params object[] args) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in any loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered. | |
void | Broadcast (Scene targetScene, string methodName) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the specified scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. | |
void | Broadcast (Scene targetScene, string methodName, params object[] args) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the specified scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. | |
void | Broadcast (Scene targetScene, Type baseType, string methodName) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the specified scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered. | |
void | Broadcast (Scene targetScene, Type baseType, string methodName, params object[] args) |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the specified scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered. | |
void | BroadcastInstance (Type baseType, string methodName) |
Attempt to invoke an instance method for all executing non-unity instances (Normal managed instances created using 'new'). Only instances deriving from the specified base type will be considered. Pass 'typeof(object)' to use no filter at all. | |
void | BroadcastInstance (Type baseType, string methodName, params object[] args) |
Attempt to invoke an instance method for all executing non-unity instances (Normal managed instances created using 'new'). Only instances deriving from the specified base type will be considered. Pass 'typeof(object)' to use no filter at all. | |
void | Dispose () |
Dispose of this domain. This will cause the target app domain to be unloaded if it is not the default app domain. The domain will be unusable after disposing. | |
void | InitializeCompilerService () |
Initializes the Roslyn compiler service if it has not yet been initialized. | |
void | ApplyCompilerServiceSettings () |
Causes the Roslyn C# settings to be loaded and applied to the Roslyn compiler service. This requires the compiler service to be initialized otherwise it will do nothing. | |
void | LogCompilerOutputToConsole () |
Log the last output of the Roslyn compiler to the Unity console. | |
ScriptAssembly | RegisterAssembly (Assembly systemAssembly, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, CompilationResult compileResult=null) |
ScriptAssembly | RegisterAssembly< T > (Assembly systemAssembly, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, CompilationResult compileResult=null) |
ScriptAssembly | RegisterAssemblyPath (Assembly systemAssembly, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, string assemblyPath=null, string assemblySymbolsPath=null, CompilationResult compileResult=null) |
ScriptAssembly | RegisterAssemblyPath< T > (Assembly systemAssembly, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, string assemblyPath=null, string assemblySymbolsPath=null, CompilationResult compileResult=null) |
ScriptAssembly | RegisterAssemblyImage (Assembly systemAssembly, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, byte[] assemblyImage=null, byte[] assemblySymbolsImage=null, CompilationResult compileResult=null) |
ScriptAssembly | RegisterAssemblyImage< T > (Assembly systemAssembly, ScriptSecurityMode securityMode=ScriptSecurityMode.UseSettings, byte[] assemblyImage=null, byte[] assemblySymbolsImage=null, CompilationResult compileResult=null) |
Static Public Member Functions | |
static ScriptDomain | CreateDomain (string domainName, bool initCompiler=true, bool makeActiveDomain=true, AppDomain sandboxDomain=null) |
Creates a new ScriptDomain into which assemblies and scripts may be loaded. | |
static ScriptDomain | FindDomain (string domainName) |
Attempt to find a domain with the specified name. | |
static void | MakeDomainActive (ScriptDomain domain) |
Set the specified domain as the active domain. The active domain is used when resolving script types from an unspecified source. | |
static void | MakeDomainActive (string domainName) |
Set the domain with the specified name as the active domain. The active domain is used when resolving script types from an unspecified source. | |
Properties | |
static ScriptDomain | Active [get] |
Get the active ScriptDomain. By default the last created domain will be active but you can also make a specific domain active using MakeDomainActive(ScriptDomain). | |
string | Name [get] |
Get the name of the domain. | |
AppDomain | SandboxDomain [get] |
Get the app domain that this ScriptDomain manages. | |
ScriptExecution | Execution [get] |
Get the ScriptExecution for this domain where all executing instances are accessible. | |
ScriptAssembly[] | Assemblies [get] |
Get all assemblies loaded into this domain. | |
ScriptAssembly[] | CompiledAssemblies [get] |
Get all assemblies loaded into this domain that have been compiled at runtime using the Roslyn runtime compiler service. | |
IEnumerable< ScriptAssembly > | EnumerateAssemblies [get] |
Enumerate all assemblies loaded into this domain. | |
IEnumerable< ScriptAssembly > | EnumerateCompiledAssemblies [get] |
Enumerate all assemblies loaded into this domain that have been compiled at runtime using the Roslyn runtime compiler service. | |
RoslynCSharpCompiler | RoslynCompilerService [get] |
Get the Roslyn runtime compiler service associated with this domain. This value will be null if the compiler service has not been initialized. | |
CompilationResult | CompileResult [get] |
Get the last compilation report as a result of compiling an assembly. | |
CodeSecurityReport | SecurityResult [get] |
Get the last security report as a result of loading or compiling an assembly. | |
bool | IsCompilerServiceInitialized [get] |
Returns true if the Roslyn compiler service is initialized and ready to recieve compile requests. | |
bool | IsDisposed [get] |
Has this domain been disposed. | |
A ScriptDomain acts as a container for all code that is loaded dynamically at runtime. The main responsiblility of the domin is to separate pre-compiled game code from runtime-loaded code. As a result, you will only be able to access types from the domain that were loaded at runtime. Any pre-compiled game code will be ignored. Any assemblies or scripts that are loaded into the domain at runtime will remain until the application exits so you should be careful to avoid loading too many assemblies. You would typically load user code at statup in a 'Load' method which would then exist and execute until the game exits. Multiple domain instances may be created but you should note that all runtime code will be loaded into the current application domain. The ScriptDomain simply masks the types that are visible.
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the specified scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances.
targetScene | The scene used to filter the broadcast. All executing behaviour instances in this scene matching the criteria will receive the broadcast |
methodName | The name of the method to invoke |
args | The argument list for the target method. All matching instances must have a compatible argument list otherwise the broadcast will fail for that particular instance |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the specified scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances.
targetScene | The scene used to filter the broadcast. All executing behaviour instances in this scene matching the criteria will receive the broadcast |
methodName | The name of the method to invoke |
args | The argument list for the target method. All matching instances must have a compatible argument list otherwise the broadcast will fail for that particular instance |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the specified scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered.
targetScene | The scene used to filter the broadcast. All executing behaviour instances in this scene matching the criteria will receive the broadcast |
baseType | A type deriving from monobehaviour that executing types must inherit from in order to receive the broadcast |
methodName | The name of the method to invoke |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the specified scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered.
targetScene | The scene used to filter the broadcast. All executing behaviour instances in this scene matching the criteria will receive the broadcast |
baseType | A type deriving from monobehaviour that executing types must inherit from in order to receive the broadcast |
methodName | The name of the method to invoke |
args | The argument list for the target method. All matching instances must have a compatible argument list otherwise the broadcast will fail for that particular instance |
|
inline |
Attempt to invoke an instance method for all executing mono bheaivour instances loaded into this domain that exist in the active loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances.
methodName | The name of the method to invoke |
|
inline |
Attempt to invoke an instance method for all executing mono bheaivour instances loaded into this domain that exist in the active loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances.
methodName | The name of the method to invoke |
args | The argument list for the target method. All matching instances must have a compatible argument list otherwise the broadcast will fail for that particular instance |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the active loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered.
baseType | A type deriving from monobehaviour that executing types must inherit from in order to receive the broadcast |
methodName | The name of the method to invoke |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in the active loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered.
baseType | A type deriving from monobehaviour that executing types must inherit from in order to receive the broadcast |
methodName | The name of the method to invoke |
args | The argument list for the target method. All matching instances must have a compatible argument list otherwise the broadcast will fail for that particular instance |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in any loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances.
methodName | The name of the method to invoke |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in any loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances.
methodName | The name of the method to invoke |
args | The argument list for the target method. All matching instances must have a compatible argument list otherwise the broadcast will fail for that particular instance |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in any loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered.
baseType | A type deriving from monobehaviour that executing types must inherit from in order to receive the broadcast |
methodName | The name of the method to invoke |
|
inline |
Attempt to invoke an instance method for all executing mono behaviour instances loaded into this domain that exist in any loaded scene. Only monobehaviour components will be considered by this broadcast. Use BroadcastInstance(Type, string, object[]) if you want to broadcast to non-monobehaviour instances. Only behaviour types deriving from the specified base type will be considered.
baseType | A type deriving from monobehaviour that executing types must inherit from in order to receive the broadcast |
methodName | The name of the method to invoke |
args | The argument list for the target method. All matching instances must have a compatible argument list otherwise the broadcast will fail for that particular instance |
|
inline |
Attempt to invoke an instance method for all executing non-unity instances (Normal managed instances created using 'new'). Only instances deriving from the specified base type will be considered. Pass 'typeof(object)' to use no filter at all.
baseType | A type that executing types must inherit from in order to receive the broadcast |
methodName | The name of the method to invoke |
|
inline |
Attempt to invoke an instance method for all executing non-unity instances (Normal managed instances created using 'new'). Only instances deriving from the specified base type will be considered. Pass 'typeof(object)' to use no filter at all.
baseType | A type that executing types must inherit from in order to receive the broadcast |
methodName | The name of the method to invoke |
args | The argument list for the target method. All matching instances must have a compatible argument list otherwise the broadcast will fail for that particular instance |
|
inline |
Compile and load the specified C# project. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
cSharpProject | The CSharpProject to compile |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# project file (.csproj). Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
cSharpProjectFile | A file path to the .csproj file to compile |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load all C# source files in a given directory. Using the searchPattern and searchOption parameters, you can control whether nested directories are scanned, as well as filter by file name and extension. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
directoryPath | The directory path to scan |
searchPattern | The file matching filter used to find source files inside the given directory. The default option '*.cs' should be fine in most cases for finding .cs source files |
searchOption | Specify whether top level or nested directories should be scanned |
securityMode | The code validation used to verify the code |
additionalReferenceAssemblies |
|
inline |
Compile and load the specified C# source file. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
cSharpFile | The filepath to a file containing C# code |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# source file asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request.
cSharpFile | The filepath to the C# source file |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# source files. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
cSharpFiles | An array of filepaths to C# source files |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# source files asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request.
cSharpFiles | An array of filepaths to C# source files |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# source file. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. This does the same as CompileAndLoadFileAsync(string, ScriptSecurityMode) but returns the main type of the ScriptAssembly for convenience.
cSharpFile | The filepath to a file containing C# code |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the speciied C# source code string. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. This does the same as CompileAndLoadSource(string, ScriptSecurityMode) but returns the main type of the ScriptAssembly for convenience. ///.
cSharpSource | The string containing C# source code |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# syntax tree. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request. This does the same as CompileAndLoadSyntaxTree(CSharpSyntaxTree, ScriptSecurityMode, IMetadataReferenceProvider[]) but returns the main type of the ScriptAssembly for convenience.
cSharpFile | The C# syntax tree to compile |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# source code string. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
cSharpSource | The string containing C# source code |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# source string asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request.
cSharpSource | The string containing C# source code |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# source code strings. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
cSharpSources | An array of C# source code strings |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# source strings asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request.
cSharpSources | An array of strings containgin C# source code |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# syntax tree. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
cSharpFile | The C# syntax tree to compile |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# syntax tree asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request.
syntaxTree | The C# syntax tree to compilee |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# syntax tree. Use CompileResult to get the output from the compile request. Use SecurityResult to get the output from the code validation request.
syntaxTrees | An array of CSharp syntax trees |
securityMode | The code validation used to verify the code |
|
inline |
Compile and load the specified C# syntax trees asynchronously. Use CompileResult of AsyncCompileOperation.CompileDomain to get the output from the compile request. Use SecurityResult of AsyncCompileOperation.CompileDomain to get the output from the code validation request.
syntaxTrees | An array of C# syntax trees to compile |
securityMode | The code validation used to verify the code |
|
inlinestatic |
Creates a new ScriptDomain into which assemblies and scripts may be loaded.
|
inlinestatic |
Attempt to find a domain with the specified name.
domainName | The domain name to search for |
|
inline |
Attempts to load the specified managed assembly into the sandbox app domain. Use SecurityResult to get the output from the code validation request.
name | The AssemblyName representing the assembly to load |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load a managed assembly from the specified raw bytes. Use SecurityResult to get the output from the code validation request.
assemblyBytes | The raw data representing the file structure of the managed assembly, The result of File.ReadAllBytes(string) for example. |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load the specified managed assembly into the sandbox app domain. Use SecurityResult to get the output from the code validation request.
fullPath | The full path to the .dll file |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load a managed assembly with the specified name asynchronously. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request.
name | The name of the assembly to load |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load a managed assembly from the specified raw bytes asynchronously. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request.
assemblyBytes | A byte array containing the managed assembly imagae data |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load a managed assembly from the specified filepath asynchronously. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request.
fullPath | The filepath to the managed assembly |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load a managed assembly from the specified resources path into the sandbox app domain. The target asset must be a TextAsset in order to be loaded successfully. Use SecurityResult to get the output from the code validation request.
resourcePath | The file name of path relative to the 'Resources' folder without the file extension |
securityMode | The security mode which determines whether code validation will run |
SecurityException | The assembly breaches the imposed security restrictions |
|
inline |
Attempts to load a managed assembly from the specified raw bytes along with debug symbols. Use this method if you want to be able to debug the specified assembly. Use SecurityResult to get the output from the code validation request.
assemblyBytes | The raw data representing the file structure of the managed assembly, The result of File.ReadAllBytes(string) for example. |
symbolBytes | The raw data representing the pdb debug symbols for the managed assembly |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load the specified managed assembly into the sandbox app domain along with pdb debug symbols. Use this method if you want to be able to debug the specified assembly. Use SecurityResult to get the output from the code validation request.
assemblyPath | The full path to the .dll file |
symbolsPath | The full path to the .pdb symbols file |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load a managed assembly from the specified raw bytes asynchronously. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request. Use this method if you want to be able to debug the specified assembly.
assemblyBytes | A byte array containing the managed assembly imagae data |
symbolBytes | A byte array containing the raw assembly pdb debug symbol image data |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load a managed assembly from the specified filepath asynchronously. Use this method if you want to be able to debug the specified assembly. Use SecurityResult of AsyncLoadOperation.LoadDomain to get the output from the code validation request.
assemblyPath | The filepath to the managed assembly |
symbolsPath | The filepath for the pdb debug symbols |
securityMode | The security mode which determines whether code validation will run |
|
inlinestatic |
Set the specified domain as the active domain. The active domain is used when resolving script types from an unspecified source.
domain | The domain to make active |
|
inlinestatic |
Set the domain with the specified name as the active domain. The active domain is used when resolving script types from an unspecified source.
domainName | The name of the domain to make active |
|
inline |
T | : | ScriptAssembly | |
T | : | new() |
|
inline |
T | : | ScriptAssembly | |
T | : | new() |
|
inline |
T | : | ScriptAssembly | |
T | : | new() |
|
inline |
Attempt to invoke a static method for all types loaded into this domain. Only static method will be considered by this broadcast. Use Broadcast(Scene, string) or BroadcastInstance(Type, string) to broadcast an instance method.
methodName | The nake of the static method to invoke |
|
inline |
Attempt to invoke a static method for all types loaded into this domain. Only static method will be considered by this broadcast. Use Broadcast(Scene, string, object[]) or BroadcastInstance(Type, string, object[]) to broadcast an instance method.
methodName | The nake of the static method to invoke |
args | The argument list for the target method. All matching static methods must have a compatible argument list otherwise the broadcast will fail for that particular call |
|
inline |
Attempts to load a managed assembly with the specified name. Any exceptions thrown while loading will be caught.
name | The AssemblyName of the assembly to load |
result | An instance of ScriptAssembly representing the loaded assembly or null if the load failed |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load a managed assembly from the raw assembly data. Any exceptions thrown while loading will be caught.
data | The raw data representing the file structure of the managed assembly, The result of File.ReadAllBytes(string) for example. |
result | An instance of ScriptAssembly representing the loaded assembly or null if the load failed |
securityMode | The security mode which determines whether code validation will run |
|
inline |
Attempts to load the managed assembly at the specified location. Any exceptions throw while loading will be caught.
fullPath | The full path to the .dll file |
result | An instance of ScriptAssembly representing the loaded assembly or null if the load failed |
securityMode | The security mode which determines whether code validation will run |