CoroutineTest.cs 572 B

123456789101112131415161718192021222324252627282930
  1. using UnityEngine;
  2. using XLua;
  3. namespace XLuaTest
  4. {
  5. public class CoroutineTest : MonoBehaviour
  6. {
  7. LuaEnv luaenv = null;
  8. // Use this for initialization
  9. void Start()
  10. {
  11. luaenv = new LuaEnv();
  12. luaenv.DoString("require 'coruntine_test'");
  13. }
  14. // Update is called once per frame
  15. void Update()
  16. {
  17. if (luaenv != null)
  18. {
  19. luaenv.Tick();
  20. }
  21. }
  22. void OnDestroy()
  23. {
  24. luaenv.Dispose();
  25. }
  26. }
  27. }