Settings / ScriptingSettings
ScriptingSettings Class
Global script configuration information
Example usage: Create a script named "ClassExample", place it in the object bar, open the script, enter the following code to save, run the game, and you will see the corresponding method call information in the Log. The code is as follows:
ts
@Component
export default class ClassExample extends Script {
protected onStart(): void {
this.ScriptingSettings();
}
public ScriptingSettings(): void {
// Set the current asynchronous search timeout
ScriptingSettings.setGlobalAsyncTimeout(1000 * 10);
}
}
@Component
export default class ClassExample extends Script {
protected onStart(): void {
this.ScriptingSettings();
}
public ScriptingSettings(): void {
// Set the current asynchronous search timeout
ScriptingSettings.setGlobalAsyncTimeout(1000 * 10);
}
}
Table of contents
Methods
setGlobalAsyncTimeout(timeout : number ): void other |
---|
Set asynchronous callback timeout |
Methods
setGlobalAsyncTimeout
• Static
setGlobalAsyncTimeout(timeout
): void
other
Set asynchronous callback timeout
Parameters
timeout number | Timeout type: floating point number< Br>range: the unit is milliseconds, and the default value is 10000 (10 seconds). |
---|
Usage example: Call method
ts
ScriptingSettings.setGlobalAsyncTimeout(1000 * 10);
const obj = await GameObject. syncFindGameObject ById ("Object Guid in Scene");
ScriptingSettings.setGlobalAsyncTimeout(1000 * 10);
const obj = await GameObject. syncFindGameObject ById ("Object Guid in Scene");