Options
All
  • Public
  • Public/Protected
  • All
Menu

The MultiplayerObjectRuntimeBehavior represents a behavior that can be added to objects to make them synchronized over the network.

Hierarchy

Index

Properties

actionOnPlayerDisconnect: string
name: string
playerNumber: number = 0
type: string

Methods

  • activate(enable: boolean): void
  • activated(): boolean
  • doStepPostEvents(): void
  • getActionOnPlayerDisconnect(): string
  • getName(): string
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • getPlayerObjectOwnership(): number
  • isObjectOwnedByCurrentPlayer(): boolean
  • onActivate(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onObjectHotReloaded(): void
  • removeObjectOwnership(): void
  • setPlayerObjectOwnership(newObjectPlayerNumber: number): void
  • takeObjectOwnership(): void
  • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean
  • Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.

    see

    gdjs.RuntimeBehavior#onObjectHotReloaded

    Parameters

    • oldBehaviorData: BehaviorData

      The previous data for the behavior.

    • newBehaviorData: BehaviorData

      The new data for the behavior.

    Returns boolean

    true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).

  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean
  • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

    Returns boolean

Constructors

Generated using TypeDoc