Documentation
¶
Overview ¶
Package MultiplayerSpawner provides methods for working with MultiplayerSpawner object instances.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AddSpawnableScene(path string)
- func (self Instance) AsMultiplayerSpawner() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) ClearSpawnableScenes()
- func (self Instance) GetSpawnableScene(index int) string
- func (self Instance) GetSpawnableSceneCount() int
- func (self Instance) ID() ID
- func (self Instance) OnDespawned(cb func(node Node.Instance), flags ...Signal.Flags)
- func (self Instance) OnSpawned(cb func(node Node.Instance), flags ...Signal.Flags)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetSpawnFunction(value Callable.Function)
- func (self Instance) SetSpawnLimit(value int)
- func (self Instance) SetSpawnPath(value string)
- func (self Instance) Spawn() Node.Instance
- func (self Instance) SpawnFunction() Callable.Function
- func (self Instance) SpawnLimit() int
- func (self Instance) SpawnPath() string
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Expanded ¶
type Expanded [1]gdclass.MultiplayerSpawner
func (Expanded) Spawn ¶
Requests a custom spawn, with [param data] passed to [member spawn_function] on all peers. Returns the locally spawned node instance already inside the scene tree, and added as a child of the node pointed by [member spawn_path]. [b]Note:[/b] Spawnable scenes are spawned automatically. [method spawn] is only needed for custom spawns.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsMultiplayerSpawner ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.MultiplayerSpawner
Spawnable scenes can be configured in the editor or through code (see [method add_spawnable_scene]). Also supports custom node spawns through [method spawn], calling [member spawn_function] on all peers. Internally, [MultiplayerSpawner] uses [method MultiplayerAPI.object_configuration_add] to notify spawns passing the spawned node as the [code]object[/code] and itself as the [code]configuration[/code], and [method MultiplayerAPI.object_configuration_remove] to notify despawns in a similar way.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddSpawnableScene ¶
Adds a scene path to spawnable scenes, making it automatically replicated from the multiplayer authority to other peers when added as children of the node pointed by [member spawn_path].
func (Instance) AsMultiplayerSpawner ¶
func (Instance) ClearSpawnableScenes ¶
func (self Instance) ClearSpawnableScenes()
Clears all spawnable scenes. Does not despawn existing instances on remote peers.
func (Instance) GetSpawnableScene ¶
Returns the spawnable scene path by index.
func (Instance) GetSpawnableSceneCount ¶
Returns the count of spawnable scene paths.
func (Instance) OnDespawned ¶
func (Instance) SetSpawnFunction ¶
func (Instance) SetSpawnLimit ¶
func (Instance) SetSpawnPath ¶
func (Instance) Spawn ¶
Requests a custom spawn, with [param data] passed to [member spawn_function] on all peers. Returns the locally spawned node instance already inside the scene tree, and added as a child of the node pointed by [member spawn_path]. [b]Note:[/b] Spawnable scenes are spawned automatically. [method spawn] is only needed for custom spawns.