ModInstance
See the code atresources/mod_instance.gd
Description
Inherits Object
The ModInstance
class represents an instance of a mod granted to an object in the Mod System. It contains references to the mod, the object it is granted to, and the instance script associated with the mod.
Properties
mod
var mod: Mod
The mod associated with this instance.
Type | Mod |
---|---|
Default | null } |
owner
var owner: Object
The object to which the mod is granted.
Type | Object |
---|---|
Default | null } |
instance_script
var instance_script: ModInstanceScript
The script to be run when the mod is granted to the owner
.
Type | ModInstanceScript |
---|---|
Default | null } |
Methods
_init
func _init(mod_value: Mod, owner_value: Object) -> void
Initializes the mod instance with the associated mod and mod owner. The mod's Mod.instance_script
is also instantiated.
Parameters
Name | Type | Description |
---|---|---|
instance_value | ModInstance | The mod instance associated with this script. |
Returns
void
grant
func grant() -> void
Grants the mod to the owner
. This method executes the instance script and performs any necessary setup or modifications on the owner
.
Returns
void
revoke
func revoke() -> void
Revokes the mod from the owner
.
Returns
void