Exemple #1
0
        public void IsCameraOverStep(ref CameraDirection direction_0, ref CameraDirection direction_1, ref Vector3 rotateValue)
        {
            //x > 0  up  y<0 right
            direction_0   = CameraDirection.None;
            direction_1   = CameraDirection.None;
            targetDummy_0 = GetRotateX(rotateValue.x);
            targetDummy_1 = GetRotateY(rotateValue.y);
            if (CameraUtility.IsBoundsInCameraView(targetDummy_1))
            {
                direction_0   = rotateValue.y > 0 ? CameraDirection.Right : CameraDirection.Left;
                rotateValue.y = 0;
            }

            if (CameraUtility.IsBoundsInCameraView(targetDummy_0))
            {
                direction_1   = rotateValue.x > 0 ? CameraDirection.Down : CameraDirection.Up;
                rotateValue.x = 0;
            }
        }
Exemple #2
0
        private bool IsBoundsInCameraView(ref Vector3 rotateValue)
        {
            Bounds bound0 = default(Bounds);
            Bounds bound1 = default(Bounds);

            if (Mathf.Abs(rotateValue.x) < Mathf.Abs(rotateValue.y) && (Mathf.Atan(Mathf.Abs(rotateValue.x / rotateValue.y))) * Mathf.Rad2Deg <= 10f)
            {
                bound1        = GetRotateY(rotateValue.y);
                rotateValue.x = 0f;

                return(CameraUtility.IsBoundsInCameraView(bound0, bound1));
            }
            else if (Mathf.Abs(rotateValue.y) < Mathf.Abs(rotateValue.x) && Mathf.Atan(Mathf.Abs(rotateValue.y / rotateValue.x)) * Mathf.Rad2Deg <= 10f)
            {
                bound0        = GetRotateX(rotateValue.x);
                rotateValue.y = 0f;
                return(CameraUtility.IsBoundsInCameraView(bound0, bound1));
            }
            bound0 = GetRotateX(rotateValue.x);
            bound1 = GetRotateY(rotateValue.y);
            return(CameraUtility.IsBoundsInCameraView(bound0, bound1));
        }
Exemple #3
0
 private bool IsSceneDownBounds(Vector3 tempVector)
 {
     return(tempVector.y < 0 && CameraUtility.IsBoundsInCameraView(sceneCameraParams.SceneDownBounds));
 }