PixelCrushers.DialogueSystem.RealisticFPSPrefab.LuaOnDestroy Class Reference

This script runs Lua code when the game object is destroyed. More...

Inheritance diagram for PixelCrushers.DialogueSystem.RealisticFPSPrefab.LuaOnDestroy:
Collaboration diagram for PixelCrushers.DialogueSystem.RealisticFPSPrefab.LuaOnDestroy:

Public Member Functions

void OnDestroy ()
 Run Lua code (and check alerts) when the game object is destroyed. More...
 
void OnLevelWillBeUnloaded ()
 If the level is being unloaded, this GameObject will be destroyed. More...
 
void OnDestroy ()
 Run Lua code (and check alerts) when the game object is destroyed. More...
 
void OnLevelWillBeUnloaded ()
 If the level is being unloaded, this GameObject will be destroyed. More...
 

Public Attributes

string luaCode
 The lua code to run. More...
 

Detailed Description

This script runs Lua code when the game object is destroyed.

You can use it to record kills by attaching it to enemy NPCs.

Member Function Documentation

◆ OnDestroy() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.LuaOnDestroy.OnDestroy ( )

Run Lua code (and check alerts) when the game object is destroyed.

It's possible that the game object is being destroyed because the application is stopping. In this case, the DialogueManager instance may have already been destroyed. We check the value of our reference to prevent accidentally creating a new DialogueManager.

◆ OnDestroy() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.LuaOnDestroy.OnDestroy ( )

Run Lua code (and check alerts) when the game object is destroyed.

It's possible that the game object is being destroyed because the application is stopping. In this case, the DialogueManager instance may have already been destroyed. We check the value of our reference to prevent accidentally creating a new DialogueManager.

◆ OnLevelWillBeUnloaded() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.LuaOnDestroy.OnLevelWillBeUnloaded ( )

If the level is being unloaded, this GameObject will be destroyed.

We don't want to run Lua in this case, so disable the script.

◆ OnLevelWillBeUnloaded() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.LuaOnDestroy.OnLevelWillBeUnloaded ( )

If the level is being unloaded, this GameObject will be destroyed.

We don't want to run Lua in this case, so disable the script.

Member Data Documentation

◆ luaCode

string PixelCrushers.DialogueSystem.RealisticFPSPrefab.LuaOnDestroy.luaCode

The lua code to run.

For example: Variable["Kills"] = Variable["Kills"] + 1


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