PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge Class Reference

This component synchronizes Core GameKit's level settings and world variables with the Dialogue System's Lua environment. More...

Inheritance diagram for PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge:
Collaboration diagram for PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge:

Public Member Functions

void Start ()
 
void OnConversationStart (Transform actor)
 When a conversation starts, syncs CoreGameKit to Lua. More...
 
void OnConversationEnd (Transform actor)
 When a conversation ends, syncs Lua to CoreGameKit. More...
 

Static Public Member Functions

static void SyncCoreGameKitToLua ()
 Records CoreGameKit variables into the Dialogue System's Lua environment. More...
 
static void SyncLevelSettingsToLua ()
 
static void SyncWorldVariablesToLua ()
 
static void SyncLuaToCoreGameKit ()
 Updates the CoreGameKit variables with the current values in the Dialogue System's Lua environment. More...
 
static void AssignWorldVariableToLua (InGameWorldVariable worldVariable, string luaVariableName)
 
static void AssignLuaResultToWorldVariable (InGameWorldVariable worldVariable, Lua.Result luaResult)
 

Detailed Description

This component synchronizes Core GameKit's level settings and world variables with the Dialogue System's Lua environment.

It automatically synchronizes before and after conversations, and you can synchronize manually using SyncCoreGameKitToLua() and SyncLuaToCoreGameKit().

For every Core GameKit world variable, there will be a corresponding entry in the Lua environment's Variable[] table. Spaces in variable names will be replaced with underscores. For example:

  • Core GameKit world variable: Experience Points
  • Lua: Variable["Experience_Points"]

The Lua variables below will also be set as read-only. They won't be synchronized back to Core GameKit.

  • Variable["Current_Level"]: Current level number.
  • Variable["Current_Wave"]: Current wave number in the current level.
  • Variable["Current_Wave_Length"]: Length of the current wave in seconds.
  • Variable["Current_Wave_Time_Remaining"]: Seconds remaining in the current wave.

Member Function Documentation

◆ AssignLuaResultToWorldVariable()

static void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.AssignLuaResultToWorldVariable ( InGameWorldVariable  worldVariable,
Lua.Result  luaResult 
)
static

◆ AssignWorldVariableToLua()

static void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.AssignWorldVariableToLua ( InGameWorldVariable  worldVariable,
string  luaVariableName 
)
static

◆ OnConversationEnd()

void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.OnConversationEnd ( Transform  actor)

When a conversation ends, syncs Lua to CoreGameKit.

Parameters
actorActor participating in the conversation.

◆ OnConversationStart()

void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.OnConversationStart ( Transform  actor)

When a conversation starts, syncs CoreGameKit to Lua.

Parameters
actorActor participating in the conversation.

◆ Start()

void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.Start ( )

◆ SyncCoreGameKitToLua()

static void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.SyncCoreGameKitToLua ( )
static

Records CoreGameKit variables into the Dialogue System's Lua environment.

◆ SyncLevelSettingsToLua()

static void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.SyncLevelSettingsToLua ( )
static

◆ SyncLuaToCoreGameKit()

static void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.SyncLuaToCoreGameKit ( )
static

Updates the CoreGameKit variables with the current values in the Dialogue System's Lua environment.

◆ SyncWorldVariablesToLua()

static void PixelCrushers.DialogueSystem.CoreGameKit.CoreGameKitLuaBridge.SyncWorldVariablesToLua ( )
static

The documentation for this class was generated from the following file: