Advertisement
Guest User

CreateMapObjectTab

a guest
Nov 13th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. /// <summary>
  2. /// On initializing the UIPage.
  3. /// </summary>
  4. protected override void OnInitPage()
  5. {
  6. base.OnInitPage();
  7.  
  8. takePhotoButton.OnClick = () =>
  9. {
  10. System.Action action = () =>
  11. {
  12. if (InstructionStateManager.GetState(InstructionStateManager.StateDictID.HasEditorTutorial) != InstructionStateManager.Value.FINISHED)
  13. {
  14. InstructionStateManager.SetState(InstructionStateManager.StateDictID.HasEditorTutorial, InstructionStateManager.Value.STARTED);
  15. this.ReportBack(true);
  16. }
  17. else
  18. {
  19. CreateNewMapObject(CameraManager.CaptureFrame());
  20. }
  21.  
  22. EditorManager.Instance.SaveCurrentProject(false);
  23. };
  24.  
  25. if (EditorManager.EditingProject.LoadedAndPlayable())
  26. {
  27. action.Invoke();
  28. }
  29. else
  30. {
  31. StartCoroutine(WaitLoadingCo(action));
  32. }
  33. };
  34.  
  35. UIEventListener listener = UIEventListener.AssignUIEventListener(this.photoDisplayObject, this.MyUIPage.GetComponent<CanvasEventCaller>());
  36. listener.PointerUp = delegate { this.UpdateFocusPoint(); };
  37.  
  38. // On clicking player icon.
  39. listener = UIEventListener.AssignUIEventListener(this.playerIconCollider.gameObject, this.MyUIPage.GetComponent<CanvasEventCaller>());
  40. listener.PointerDown = delegate { this.OnClickDownPlayer(); };
  41.  
  42. playerScaleSlider.onValueChanged.AddListener(OnScaleSliderValueChanged);
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement