예제 #1
0
 public void OnPointerDown(PointerEventData eventData)
 {
     fore.gameObject.SetActive(true);
     backGround.gameObject.SetActive(true);
     fore.transform.position = AmendMousePosition();
     state = HandShankState.Active;
 }
예제 #2
0
파일: JoyStick.cs 프로젝트: Hengle/Fish
    public void OnPointerDown(PointerEventData eventData)
    {
        this.m_Fore.SetActive(true);
        this.m_BackGround.SetActive(true);
        if (this.m_Arrow)
        {
            this.m_Arrow.SetActive(true);
        }

        UpdateArrowDirection();

        var mousePosition = ClampMousePosition(eventData.position, eventData.pressEventCamera);

        this.m_Fore.transform.position = mousePosition;

        var backGroundPosition = mousePosition;

        if (this.m_MovePort != null)
        {
            var min = UIUtil.GetMinWorldPosition(this.m_MovePort);
            var max = UIUtil.GetMaxWorldPosition(this.m_MovePort);
            backGroundPosition = backGroundPosition.SetX(Mathf.Clamp(mousePosition.x, min[0], max[0]));
            backGroundPosition = backGroundPosition.SetY(Mathf.Clamp(mousePosition.y, min[1], max[1]));
        }
        this.m_BackGround.position = backGroundPosition;

        this.state = HandShankState.Active;
    }
예제 #3
0
 public void OnPointerUp(PointerEventData eventData)
 {
     fore.gameObject.SetActive(false);
     backGround.gameObject.SetActive(false);
     state = HandShankState.UnActive;
 }
예제 #4
0
 private void OnEnable()
 {
     fore.gameObject.SetActive(false);
     backGround.gameObject.SetActive(false);
     state = HandShankState.UnActive;
 }
예제 #5
0
파일: JoyStick.cs 프로젝트: Hengle/Fish
 public void OnPointerUp(PointerEventData eventData)
 {
     Hide(this.m_HideOnRelease);
     ResetPosition();
     this.state = HandShankState.UnActive;
 }
예제 #6
0
파일: JoyStick.cs 프로젝트: Hengle/Fish
 private void OnEnable()
 {
     Hide(this.m_HideOnRelease);
     ResetPosition();
     this.state = HandShankState.UnActive;
 }