GameInitializationEvent Module
Game initialization event
Using the listener interface and the GameInitializationEvent.attempt method, you can perform fallible setup tasks that will be safely reported to the user if they go wrong.
Example
member this.Awake() =
GameInitializationEvent.EVENT.Register this
interface GameInitializationEvent.Listener with
member this.Initialize() =
GameInitializationEvent.attempt this.Info (fun () ->
// fallible logic goes here.
)
Types
Type | Description |
Functions and values
Function or value | Description |
Full Usage:
Register info applier
Parameters:
PluginInfo
-
Metadata used when displaying errors
applier : Action
-
Wrapped function
|
This function lets you easily set up an initialization callback in C# without having to convert to F# functions manually. An exception thrown in here will safely stop the game loading, and the error will be displayed to the user.
|
Full Usage:
attempt info applier
Parameters:
PluginInfo
-
Metadata used when displaying errors
applier : unit -> unit
-
Wrapped function
Returns: Result<unit, LoadError>
|
An exception thrown in here will safely stop the game loading, and the error will be displayed to the user.
|