Beispiel #1
0
        void ProcessInput()
        {
            //Debug.Log("WorldSphereController.ProcesInput: rotation enabled = " + rotationEnabled.ToString());
            if (rotationEnabled)
            {
                TouchInput.InputStatus inputStatus = GlobalManager.MInput.CheckInput();
                //Debug.Log("WorldSphereController.ProcessInput: " + inputStatus.ToString());
                switch (inputStatus)
                {
                case TouchInput.InputStatus.SinglePress:
                case TouchInput.InputStatus.DoublePress:
                    EnableRotation(false);
                    EnableRotation(true);
                    break;

                case TouchInput.InputStatus.SingleMove:
                    // rotate the world to the direction of a finger/mouse move
                    EnableRotation(false);
                    Vector3 moveDelta      = GlobalManager.MInput.MoveDelta;
                    float   cameraDistance = Camera.main.transform.position.z;
                    Vector3 rotateDelta    = new Vector3(moveDelta.y, -moveDelta.x, 0) * cameraDistance * worldRotateFactor;
                    transform.Rotate(rotateDelta, Space.World);
                    EnableRotation(true);
                    break;

                case TouchInput.InputStatus.DoubleMove:
                    // rotate the world around z-axis
                    EnableRotation(false);
                    transform.Rotate(new Vector3(0, 0, GlobalManager.MInput.AngleDelta), Space.World);
                    EnableRotation(true);
                    break;
                }
            }
        }
 void ProcessInput()
 {
     TouchInput.InputStatus inputStatus = GlobalManager.MInput.CheckInput();
     //Debug.Log("WorldCameraController.ProcessInput: " + inputStatus.ToString());
     switch (inputStatus)
     {
     case TouchInput.InputStatus.DoubleMove:
         ManualZoom(GlobalManager.MInput.MoveDelta);
         break;
     }
 }