Beispiel #1
0
    public void Update()
    {
                #if !UNITY_EDITOR
        if (Input.touchCount <= m_TouchID)
        {
            return;
        }
                #endif

        if (m_TouchDidBegin && m_NumberOfTouches != Input.touchCount)
        {
            //Reset
            m_LastPosition = TouchInputWrapper.GetTouchPosition(m_TouchID);
        }


        if (GetTouchBegan())
        {
            m_TouchDidMove   = false;
            m_TouchDidBegin  = true;
            m_TouchBeganTime = Time.realtimeSinceStartup;
            m_LastPosition   = TouchInputWrapper.GetTouchPosition(m_TouchID);
        }
        else if (GetTouchEnded())
        {
            m_TouchDidMove  = false;
            m_TouchDidBegin = false;
        }
        else if (GetTouchMoved())
        {
//			Debug.Log("GetTouchMoved");
            m_TouchDidMove = true;
            //sample data
            TakeSample();
            m_LastPosition = TouchInputWrapper.GetTouchPosition(m_TouchID);
        }
        else if (GetTouchStationary())
        {
        }

        m_NumberOfTouches = Input.touchCount;
    }
Beispiel #2
0
 public Vector2 GetPosition()
 {
     return(TouchInputWrapper.GetTouchPosition(m_TouchID));
 }