Photon Quantum 3.0.0

Classes | Static Public Member Functions | Static Public Attributes | Properties | List of all members
Quantum.Core.DebugCommand Class Reference

The DebugCommand class allows to send debug commands to the simulation. It's used by the Quantum state inspector for example. The system is completely disabled in non-development builds or when defining QUANTUM_DEBUG_COMMAND_DISABLED. More...

Classes

struct  Payload
 The debug command payload. More...
 

Static Public Member Functions

static Payload CreateDestroyPayload (EntityRef entityRef)
 Factory to create a destroy entity debug command payload. More...
 
static Payload CreateMaterializePayload (EntityRef entityRef, EntityPrototype prototype, IAssetSerializer serializer)
 Factory to create the payload to create a new entity from an entity prototype. More...
 
static Payload CreateRemoveComponentPayload (EntityRef entityRef, Type componentType)
 Factory to create the payload to remove a component from an entity. More...
 
static void Reset ()
 Reset the debug command system and invalidate the CommandExecuted callback. More...
 
static bool Send (QuantumGame game, params Payload[] payload)
 Sends a debug command. More...
 

Static Public Attributes

static bool IsEnabled
 Returns true when the debug command system is enabled. More...
 

Properties

static Action< Payload, Exception > CommandExecuted
 A callback Action that is invoked when a debug command was executed. More...
 

Detailed Description

The DebugCommand class allows to send debug commands to the simulation. It's used by the Quantum state inspector for example. The system is completely disabled in non-development builds or when defining QUANTUM_DEBUG_COMMAND_DISABLED.

Member Function Documentation

◆ Send()

static bool Quantum.Core.DebugCommand.Send ( QuantumGame  game,
params Payload[]  payload 
)
inlinestatic

Sends a debug command.

Parameters
gameThe reference game.
payloadThe command payloads can include multiple instances.

◆ Reset()

static void Quantum.Core.DebugCommand.Reset ( )
inlinestatic

Reset the debug command system and invalidate the CommandExecuted callback.

◆ CreateDestroyPayload()

static Payload Quantum.Core.DebugCommand.CreateDestroyPayload ( EntityRef  entityRef)
inlinestatic

Factory to create a destroy entity debug command payload.

Parameters
entityRefEntity to destroy.
Returns
Debug command payload.

◆ CreateMaterializePayload()

static Payload Quantum.Core.DebugCommand.CreateMaterializePayload ( EntityRef  entityRef,
EntityPrototype  prototype,
IAssetSerializer  serializer 
)
inlinestatic

Factory to create the payload to create a new entity from an entity prototype.

Parameters
entityRefIf set, then the existing entity will be overwritten, if not set a new entity will be created.
prototypeOptionally the entity prototype to use. Can be null.
serializerThe serializer.
Returns
The debug command payload.

◆ CreateRemoveComponentPayload()

static Payload Quantum.Core.DebugCommand.CreateRemoveComponentPayload ( EntityRef  entityRef,
Type  componentType 
)
inlinestatic

Factory to create the payload to remove a component from an entity.

Parameters
entityRefThe entity to remove a component from.
componentTypeThe component type to remove.
Returns
The debug command payload.

Member Data Documentation

◆ IsEnabled

bool Quantum.Core.DebugCommand.IsEnabled
static
Initial value:
=>
false

Returns true when the debug command system is enabled.

Property Documentation

◆ CommandExecuted

Action<Payload, Exception> Quantum.Core.DebugCommand.CommandExecuted
staticaddremove

A callback Action that is invoked when a debug command was executed.