Base class for unity behaviours that want to access Bolt methods More...
Public Member Functions | |
virtual void | Attached () |
Invoked when Bolt is aware of this entity and all internal state has been setup More... | |
virtual void | ControlGained () |
Invoked when you gain control of this entity More... | |
virtual void | ControlLost () |
Invoked when you lost control of this entity More... | |
virtual void | Detached () |
Invoked when this entity is removed from Bolt's awareness More... | |
virtual void | ExecuteCommand (Bolt.Command command, bool resetState) |
Invoked on both the owner and controller to execute a command More... | |
virtual void | Initialized () |
Invoked when the entity has been initialized, before Attached More... | |
virtual bool | LocalAndRemoteResultEqual (Bolt.Command command) |
Utility callback used to signal to the user that this entity is about to be reset by a Command Result. Using this method, you are able to signal Bolt that the Result of the Command is equaled the current state of your entity, skipping all the recomputation needed when a Reset command arrives. More... | |
virtual void | MissingCommand (Bolt.Command previous) |
Invoked on the owner when a remote connection is controlling this entity but we have not received any command for the current simulation frame. More... | |
virtual void | SimulateController () |
Invoked each simulation step on the controller More... | |
virtual void | SimulateOwner () |
Invoked each simulation step on the owner More... | |
Properties | |
BoltEntity | entity [get, set] |
The entity for this behaviour More... | |
Base class for unity behaviours that want to access Bolt methods
Example: Using Bolt.EntityBehaviour
to write a simple PlayerController class. Attach to a valid bolt entity/prefab.
|
inlinevirtual |
Invoked when Bolt is aware of this entity and all internal state has been setup
Example: Overriding the Attached()
method to add state change callbacks to the newly valid state.
|
inlinevirtual |
Invoked when you gain control of this entity
Example: Using the ControlGained()
callback to set up a GameCamera
and MiniMap
to focus on this entity.
|
inlinevirtual |
Invoked when you lost control of this entity
Example: Using the ControlLost()
callback to remove the focus of a GameCamera
and MiniMap
.
|
inlinevirtual |
|
inlinevirtual |
Invoked on both the owner and controller to execute a command
command | The command to execute |
resetState | Indicates if we should reset the state of the local motor or not |
Example: Executing a simple WASD movement command. On the client this method can be called multiple times per fixed frame, beginning with a reset to the last confirmed state (resetState == true), and then again for each unverified input command in the queue (resetState == false);
Use the cmd.isFirstExecution property to do any type of one-shot behaviour such as playing sound or animations. This will prevent it from being called each time the input is replayed on the client.
Remember to create and compile a Command asset before using this method!
|
inlinevirtual |
Invoked when the entity has been initialized, before Attached
Example: Notifying a MiniMap
class to draw this gameObject by overriding the Initialized()
method.
Reimplemented in Photon.Bolt.Internal.EntityEventListenerBase.
|
inlinevirtual |
Utility callback used to signal to the user that this entity is about to be reset by a Command Result. Using this method, you are able to signal Bolt that the Result of the Command is equaled the current state of your entity, skipping all the recomputation needed when a Reset command arrives.
command | The Command with ResetState flag as true for ExecuteCommand callback |
|
inlinevirtual |
Invoked on the owner when a remote connection is controlling this entity but we have not received any command for the current simulation frame.
previous | The last valid command received |
Example: Handling missing input commands by using the last received input command to continue moving in the same direction.
|
inlinevirtual |
Invoked each simulation step on the controller
Example: Creating a simple WASD-style movement input command and adding it to the queue of inputs. One input command should be added to the queue per execution and remember to create and compile a Command asset before using this method!
|
inlinevirtual |
Invoked each simulation step on the owner
Example: Implementing an authoritative health regeneration update every 10th frame. Also fires the DeathTrigger()
on the state if health falls below zero.
|
getset |
The entity for this behaviour
Use the entity
property to access the internal BoltEntity
of the gameObject that this script is attached to.
Example: Passing the entity
of this gameObject to a MiniMap
, giving it the position, facing direction and the entity state (such as team, alive/dead, hostile, etc).