Dialogue condition issue
Posted: Wed Feb 28, 2018 10:10 am
Hi, I'm trying to pass a variable to the dialogue system from my script and using it as a condition in a dialogue but my script is not working and there are no errors in the console. Here's my script.
(I've added this script to the dialogue manager in my scene)
and this is a screenshot of the condition in dialogue window:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
namespace PixelCrushers.DialogueSystem{
public class EntropyLuaIntegration : MonoBehaviour{
void OnEnable() {
// Lua.RegisterFunction("HaveStoryItem", this, typeof(bool).GetMethod("HaveStoryItem"));
// Lua.RegisterFunction("IsChapter", this, typeof(bool).GetMethod("IsChapter"));
Lua.RegisterFunction("StringInShortcuts", this, typeof(bool).GetMethod("StringInShortcuts"));
}
void OnDisable() {
// Lua.UnregisterFunction("IsChapter");
// Lua.UnregisterFunction("HaveStoryItem");
Lua.UnregisterFunction("StringInShortcuts");
}
// public bool HaveStoryItem(string name) {
// if(SavingManager.Manager.SST.StoryItem.Contains(name)){
// return true;
// }
// else {
// return false;
// }
// }
//
// public bool IsChapter(double Chapter) {
// if(SavingManager.Manager.SST.Chapter == Chapter){
// return true;
// }
// else {
// return false;
// }
// }
public bool StringInShortcuts(string name) {
return SavingManager.Manager.SST.Shortcuts.Contains(name);
}
}
}
and this is a screenshot of the condition in dialogue window: