@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 623a31d1ed64f48c18a2941fb2e6bb4b |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: c464247e0cb064d63ba47e22509fc0b0 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 3e8003ca74cfb4a99983b0084a826c72 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 0c0251f25261847649112eb90bdc787c |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 5a4fe51b67cee49b28f6a0231dae2352 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 3dd9a7f66888345859cf2db40ceee354 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: d4ee6befb080e414984229c6b24358ae |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 6e9a956b0b8294e4f82ab030bb93a8e4 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 3d2b8d81dbfb54c02a92a0966802a55a |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: e3391e010f66a4399adbe2bd0de43a83 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 42741b4e7e5d44f8b8268e93d23ee33e |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,7 +1,7 @@ |
|||||||
fileFormatVersion: 2 |
fileFormatVersion: 2 |
||||||
guid: 02938c86564af4507b9db82f939ff484 |
guid: 5441286d76a2f47c7a2ea683709ea59e |
||||||
folderAsset: yes |
folderAsset: yes |
||||||
timeCreated: 1473756679 |
timeCreated: 1473781211 |
||||||
licenseType: Free |
licenseType: Free |
||||||
DefaultImporter: |
DefaultImporter: |
||||||
userData: |
userData: |
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 57bf29b4215da4cf9b7c331fe6283c12 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: ef11f1c72b929498e835aa270145bf96 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,9 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 895ead76bb3488c4481a5ae7d88c03df |
|
||||||
folderAsset: yes |
|
||||||
timeCreated: 1462775995 |
|
||||||
licenseType: Pro |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
||||||
assetBundleName: |
|
||||||
assetBundleVariant: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 10357f1ebe4137642ab1716a03b5737c |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 791c611829c954bc8bacad62f4ed4b71 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: f79fc50442aef4dc7a950abab31ec36a |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: cb76d2003b2004cd3ace7c8a0b5fd276 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 95007f6e545624b21a39aa21c579dcee |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,101 +0,0 @@ |
|||||||
// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). |
|
||||||
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) |
|
||||||
|
|
||||||
using UnityEngine; |
|
||||||
using UnityEngine.UI; |
|
||||||
using System.Collections; |
|
||||||
using Fungus; |
|
||||||
using MoonSharp.Interpreter; |
|
||||||
|
|
||||||
namespace Fungus |
|
||||||
{ |
|
||||||
|
|
||||||
public static class LuaExtensions |
|
||||||
{ |
|
||||||
|
|
||||||
/// <summary> |
|
||||||
/// Extension for MenuDialog that allows AddOption to call a Lua function when an option is selected. |
|
||||||
/// </summary> |
|
||||||
public static bool AddOption(this MenuDialog menuDialog, string text, bool interactable, ILuaEnvironment luaEnv, Closure callBack) |
|
||||||
{ |
|
||||||
if (!menuDialog.gameObject.activeSelf) |
|
||||||
{ |
|
||||||
menuDialog.gameObject.SetActive(true); |
|
||||||
} |
|
||||||
|
|
||||||
bool addedOption = false; |
|
||||||
foreach (Button button in menuDialog.CachedButtons) |
|
||||||
{ |
|
||||||
if (!button.gameObject.activeSelf) |
|
||||||
{ |
|
||||||
button.gameObject.SetActive(true); |
|
||||||
|
|
||||||
button.interactable = interactable; |
|
||||||
|
|
||||||
Text textComponent = button.GetComponentInChildren<Text>(); |
|
||||||
if (textComponent != null) |
|
||||||
{ |
|
||||||
textComponent.text = text; |
|
||||||
} |
|
||||||
|
|
||||||
button.onClick.AddListener(delegate { |
|
||||||
|
|
||||||
menuDialog.StopAllCoroutines(); // Stop timeout |
|
||||||
menuDialog.Clear(); |
|
||||||
menuDialog.HideSayDialog(); |
|
||||||
|
|
||||||
if (callBack != null) |
|
||||||
{ |
|
||||||
luaEnv.RunLuaFunction(callBack, true); |
|
||||||
} |
|
||||||
}); |
|
||||||
|
|
||||||
addedOption = true; |
|
||||||
break; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
return addedOption; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary> |
|
||||||
/// Extension for MenuDialog that allows ShowTimer to call a Lua function when the timer expires. |
|
||||||
/// </summary> |
|
||||||
public static IEnumerator ShowTimer(this MenuDialog menuDialog, float duration, ILuaEnvironment luaEnv, Closure callBack) |
|
||||||
{ |
|
||||||
if (menuDialog.CachedSlider == null || |
|
||||||
duration <= 0f) |
|
||||||
{ |
|
||||||
yield break; |
|
||||||
} |
|
||||||
|
|
||||||
menuDialog.CachedSlider.gameObject.SetActive(true); |
|
||||||
menuDialog.StopAllCoroutines(); |
|
||||||
|
|
||||||
float elapsedTime = 0; |
|
||||||
Slider timeoutSlider = menuDialog.GetComponentInChildren<Slider>(); |
|
||||||
|
|
||||||
while (elapsedTime < duration) |
|
||||||
{ |
|
||||||
if (timeoutSlider != null) |
|
||||||
{ |
|
||||||
float t = 1f - elapsedTime / duration; |
|
||||||
timeoutSlider.value = t; |
|
||||||
} |
|
||||||
|
|
||||||
elapsedTime += Time.deltaTime; |
|
||||||
|
|
||||||
yield return null; |
|
||||||
} |
|
||||||
|
|
||||||
menuDialog.Clear(); |
|
||||||
menuDialog.gameObject.SetActive(false); |
|
||||||
menuDialog.HideSayDialog(); |
|
||||||
|
|
||||||
if (callBack != null) |
|
||||||
{ |
|
||||||
luaEnv.RunLuaFunction(callBack, true); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 382433a04f0cc44d1b777c359b0242a3 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 6b96d35ab90bb48fc9c41a3a2d147736 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 805471f08101f4ad8a705fc863435758 |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: bbcb57c04f3008e4391c6b2866a718fb |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 92e86c1e0db8e4ea29c05df76d0cff9e |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 04b9ccf7cc1a64058ad9340ed03b4a8b |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,5 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 0bb03bbaacb014e7399075a2d6ecad3f |
|
||||||
folderAsset: yes |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
@ -1,9 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 84aaac902c28b47f89fefe8205397661 |
|
||||||
folderAsset: yes |
|
||||||
timeCreated: 1473756719 |
|
||||||
licenseType: Free |
|
||||||
DefaultImporter: |
|
||||||
userData: |
|
||||||
assetBundleName: |
|
||||||
assetBundleVariant: |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@ -1,7 +1,7 @@ |
|||||||
fileFormatVersion: 2 |
fileFormatVersion: 2 |
||||||
guid: eb9106aaabbf94f978cec3f7bf29790e |
guid: fc921ee1d765948f0b788694e06b4a4a |
||||||
folderAsset: yes |
folderAsset: yes |
||||||
timeCreated: 1459937141 |
timeCreated: 1473780677 |
||||||
licenseType: Free |
licenseType: Free |
||||||
DefaultImporter: |
DefaultImporter: |
||||||
userData: |
userData: |