TestLock.cs 785 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using UnityEngine;
  6. public class TestLock : MonoBehaviour
  7. {
  8. ThreadStart threadStart;
  9. Thread childThread;
  10. private void Start()
  11. {;
  12. threadStart = new ThreadStart(TestThread);
  13. // ScenceMain.Instance.AddThead(ThreadTest1, null);
  14. childThread = new Thread(threadStart);
  15. childThread.Start();
  16. }
  17. private void TestThread()
  18. {
  19. while(true)
  20. {
  21. Thread.Sleep(1000);
  22. Debug.Log("2222222222222222222");
  23. }
  24. }
  25. public void lockApp()
  26. {
  27. //UnityToJava.SetLock();
  28. }
  29. public void UnLock()
  30. {
  31. // UnityToJava.UnLock();
  32. }
  33. private void Update()
  34. {
  35. }
  36. }