Ejemplo n.º 1
0
 private void RemoveAllTouchIndex(int p_fingerIndex)
 {
     for (mg_ss_InputTouch mg_ss_InputTouch2 = FindTouch(p_fingerIndex); mg_ss_InputTouch2 != null; mg_ss_InputTouch2 = FindTouch(p_fingerIndex))
     {
         m_touches.Remove(mg_ss_InputTouch2);
     }
 }
Ejemplo n.º 2
0
        private void OnTouchDown(Gesture p_gesture)
        {
            mg_ss_InputTouch mg_ss_InputTouch2 = FindTouch(p_gesture.fingerIndex);

            if (mg_ss_InputTouch2 != null)
            {
                mg_ss_InputTouch2.Position = p_gesture.position;
            }
        }
Ejemplo n.º 3
0
        public mg_ss_InputTouch GetTouch()
        {
            mg_ss_InputTouch result = null;

            if (m_touches.Count > 0)
            {
                result = m_touches[0];
            }
            return(result);
        }
Ejemplo n.º 4
0
        private void OnTouchStart(Gesture p_gesture)
        {
            mg_ss_InputTouch mg_ss_InputTouch2 = new mg_ss_InputTouch();

            mg_ss_InputTouch2.FingerIndex = p_gesture.fingerIndex;
            mg_ss_InputTouch2.Position    = p_gesture.position;
            mg_ss_InputTouch mg_ss_InputTouch3 = mg_ss_InputTouch2;

            RemoveAllTouchIndex(mg_ss_InputTouch3.FingerIndex);
            m_touches.Add(mg_ss_InputTouch3);
        }
Ejemplo n.º 5
0
        private void UpdateXDestination(float p_deltaTime)
        {
            mg_ss_InputTouch touch = m_inputManager.GetTouch();

            if (touch != null)
            {
                WorldTouch = m_mainCamera.ScreenToWorldPoint(touch.Position);
                m_playerObject.UpdatePosX(p_deltaTime);
            }
            if (InputObserver.CurrentSteering != Vector2.zero)
            {
                m_playerObject.UpdatePosX(p_deltaTime, InputObserver.CurrentSteering);
            }
        }
Ejemplo n.º 6
0
        private mg_ss_InputTouch FindTouch(int p_fingerIndex)
        {
            mg_ss_InputTouch result = null;

            foreach (mg_ss_InputTouch touch in m_touches)
            {
                if (touch.FingerIndex == p_fingerIndex)
                {
                    result = touch;
                    break;
                }
            }
            return(result);
        }