Browse Source

Force MenuDialog to become active when using AddOption from Lua.

master
Christopher 9 years ago
parent
commit
689928a23d
  1. 5
      Assets/Fungus/Lua/Scripts/LuaExtensions.cs

5
Assets/Fungus/Lua/Scripts/LuaExtensions.cs

@ -20,6 +20,11 @@ namespace Fungus
/// </summary> /// </summary>
public static bool AddOption(this MenuDialog menuDialog, string text, bool interactable, LuaEnvironment luaEnvironment, Closure callBack) public static bool AddOption(this MenuDialog menuDialog, string text, bool interactable, LuaEnvironment luaEnvironment, Closure callBack)
{ {
if (!menuDialog.gameObject.activeSelf)
{
menuDialog.gameObject.SetActive(true);
}
bool addedOption = false; bool addedOption = false;
foreach (Button button in menuDialog.cachedButtons) foreach (Button button in menuDialog.cachedButtons)
{ {

Loading…
Cancel
Save