using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; using System.Collections; using System.Collections.Generic; using System.Linq; using MoonSharp.Interpreter; using MoonSharp.Interpreter.Loaders; public class FirstTest : MonoBehaviour { //============================================================ // 変数宣言 //============================================================ //-------------------------------------------------- // public //-------------------------------------------------- [MoonSharpUserData] class MyLua { FirstTest m_Parent; public MyLua(FirstTest parent) { m_Parent = parent; } public void TimeWait() { if (m_Parent != null) m_Parent.SetTimeWait(); } public void KeyWait() { if (m_Parent != null) m_Parent.SetKeyWait(); } public void NoWait() { if (m_Parent != null) m_Parent.SetNoWait(); } public void AnsWait() { if (m_Parent != null) m_Parent.SetAnsWait(); } public void ActWait() { if (m_Parent != null) m_Parent.SetActWait(); } public void AddAsk(string sAsk) { if (m_Parent != null) m_Parent.AddAsk(sAsk); } public int GetAnswer() { if (m_Parent != null) return m_Parent.Answer; return -1; } } public enum EZ_WAIT_KEY { _NONE // 待たない ,TIME // 時間待ち ,KEY // キー入力待ち ,ANSWER // 返答入力待ち ,ACTION // アクション待ち } public EZ_WAIT_KEY WaitKey { get; private set; } public int Answer { get; private set; } public void SetNoWait() { WaitKey = EZ_WAIT_KEY._NONE; } public void SetTimeWait() { WaitKey = EZ_WAIT_KEY.TIME; } public void SetKeyWait() { WaitKey = EZ_WAIT_KEY.KEY; } public void SetAnsWait() { WaitKey = EZ_WAIT_KEY.ANSWER; } public void SetActWait() { WaitKey = EZ_WAIT_KEY.ACTION; } //-------------------------------------------------- // private //-------------------------------------------------- private GameObject m_PrefAskPanel; private List