Exemple #1
0
    private void ProcessTouchMove(CollisionManager.TouchInformation touchInfo, CollisionManager.TouchInformation touchInfo1,
                                  bool injectGUI, GameObject hitGameObject)
    {
        if (_Pressed == false)
        {
            return;
        }
        ProcessPressMovement(touchInfo);

        /*
         * //it's a room in out event
         * if (touchInfo1._Type == CollisionManager.TOUCH_EVENT_TYPE.MOVE)
         * {
         *  //if (IsEnlarge(_oldTouchPosition1, _oldTouchPosition2, touchInfo._TouchPosition, touchInfo1._TouchPosition))
         *  //{
         *  //}
         *  float oldSQRDistance = (_oldTouchPosition2 - _oldTouchPosition1).magnitude;
         *  float newSQRDistance = (touchInfo1._TouchPosition - touchInfo._TouchPosition).magnitude;
         *  float scaleDelta = newSQRDistance - oldSQRDistance;
         *
         *
         *  //Vector3 FaceDirection, RightDirection;
         *  //GetMoveDirection(out FaceDirection, out RightDirection);
         *  //Vector3 DestVelocity = Vector3.zero;
         *  //DestVelocity += touchInfo._TouchDelta.y * _Speed * FaceDirection;
         *  //DestVelocity += touchInfo._TouchDelta.x * _Speed * RightDirection;
         *  //_SelfTransform.position -= DestVelocity;
         *
         *  _SelfTransform.position += _SelfTransform.forward * scaleDelta * 0.1f;
         *
         *  _oldTouchPosition1 = touchInfo._TouchPosition;
         *  _oldTouchPosition2 = touchInfo1._TouchPosition;
         * }*/
    }
 private void ProcessTouchMove(CollisionManager.TouchInformation touchInfo,
                               CollisionManager.TouchInformation touchInfo1, bool injectGUI, GameObject hitGameObject)
 {
     if (m_pressed == false)
     {
         return;
     }
     m_deltaX = touchInfo.m_touchDelta.x;
     ProcessPressMovement(touchInfo);
 }
Exemple #3
0
    private void ProcessPressMovement(CollisionManager.TouchInformation touchInfo)
    {
        Vector3 FaceDirection, RightDirection;

        GetMoveDirection(out FaceDirection, out RightDirection);
        Vector3 DestVelocity = Vector3.zero;

        DestVelocity            += touchInfo._TouchDelta.y * _Speed * FaceDirection;
        DestVelocity            += touchInfo._TouchDelta.x * _Speed * RightDirection;
        _SelfTransform.position -= DestVelocity;
    }
 //The process touch founcitons
 private void ProcessTouchPress(CollisionManager.TouchInformation touchInfo,
                                CollisionManager.TouchInformation touchInfo1, bool injectGUI, GameObject hitGameObject)
 {
     if (injectGUI)
     {
         return;
     }
     ProcessPressMovement(touchInfo);
     m_pressTime          = 0.0f;
     m_touchPressPosition = touchInfo.m_touchPosition;
     m_deltaMovement      = Vector2.zero;
     m_pressed            = true;
 }
Exemple #5
0
 private void ProcessTouchRelease(CollisionManager.TouchInformation touchInfo, CollisionManager.TouchInformation touchInfo1,
                                  bool injectGUI, GameObject hitGameObject)
 {
     if (_Pressed)
     {
         Vector2 DeletaRange = _TouchPressPosition - touchInfo._TouchPosition;
         if ((_PressTime < c_fMaxPressTime) && (DeletaRange.sqrMagnitude >= c_fMoveCheckRange * c_fMoveCheckRange))
         {
             _DeltaMovement += (DeletaRange / _PressTime) * c_fReleaseMoveTime * _AccumulateMoveRatio;
         }
     }
     _Pressed   = false;
     _PressTime = 0.0f;
 }
 private void ProcessTouchRelease(CollisionManager.TouchInformation touchInfo,
                                  CollisionManager.TouchInformation touchInfo1, bool injectGUI, GameObject hitGameObject)
 {
     if (m_pressed && (!m_isRoomIn))
     {
         Vector2 DeletaRange = m_touchPressPosition - touchInfo.m_touchPosition;
         if ((m_pressTime < mc_fMaxPressTime) &&
             (DeletaRange.sqrMagnitude >= mc_fMoveCheckRange * mc_fMoveCheckRange))
         {
             m_deltaMovement += (DeletaRange / m_pressTime) * mc_fReleaseMoveTime * m_accumulateMoveRatio;
         }
     }
     m_pressed   = false;
     m_pressTime = 0.0f;
 }
Exemple #7
0
    //The process touch founcitons
    private void ProcessTouchPress(CollisionManager.TouchInformation touchInfo, CollisionManager.TouchInformation touchInfo1,
                                   bool injectGUI, GameObject hitGameObject)
    {
        if (injectGUI == true)
        {
            return;
        }
        ProcessPressMovement(touchInfo);
        _PressTime          = 0.0f;
        _TouchPressPosition = touchInfo._TouchPosition;
        _DeltaMovement      = Vector2.zero;
        _Pressed            = true;
        //it's a rotate event

        _oldTouchPosition1 = touchInfo._TouchPosition;
        _oldTouchPosition2 = touchInfo1._TouchPosition;

        if (touchInfo1._Type == CollisionManager.TOUCH_EVENT_TYPE.MOVE)
        {
        }
    }