ScreenLocate.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ZIM;
  5. /// <summary>
  6. /// JC-补充接口
  7. /// </summary>
  8. public partial class ScreenLocate : MonoBehaviour
  9. {
  10. public bool IsScreenLoateOK()
  11. {
  12. return screenIdentification != null &&
  13. screenIdentification.Screen != null &&
  14. screenIdentification.Screen.Active;
  15. }
  16. public bool IsScreenLocateManualDoing()
  17. {
  18. return mode == Mode.ScreenLocateManual;
  19. }
  20. public Texture2D EnterScreenLocateManual()
  21. {
  22. CreateUVCTexture2DIfNeeded();
  23. Texture2D texture = mUVCTexture2D.zimAutoLight(0);
  24. mode = Mode.ScreenLocateManual;
  25. return texture;
  26. }
  27. public void QuitScreenLocateManual(List<Vector2> points)
  28. {
  29. if (points != null && points.Count == 4)
  30. {
  31. screenIdentification.LocateScreenManual(
  32. new OrdinalQuadrilateral(
  33. points[0].o0Vector(),
  34. points[1].o0Vector(),
  35. points[3].o0Vector(),
  36. points[2].o0Vector()
  37. )
  38. );
  39. }
  40. ToMode(Mode.InfraredLocate);
  41. }
  42. }