Esempio n. 1
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
     {
         RotateAndZoomManager.StartCameraZoom(center, 2, 10);
         RotateAndZoomManager.StartCameraAroundCenter(center);
     }
     if (Input.GetKeyDown(KeyCode.W))
     {
         RotateAndZoomManager.StopCameraAroundCenter();
         RotateAndZoomManager.StopCameraZoom();
     }
 }
Esempio n. 2
0
 private void Start()
 {
     RotateAndZoomManager.StartCameraZoom(center, 2, 20);
     RotateAndZoomManager.StartCameraAroundCenter(center);
     MSwitchManager.OnInitializeMode(OperateModeType.Move | OperateModeType.Rotate | OperateModeType.Zoom);
 }
Esempio n. 3
0
        /// <summary>
        /// 开启物体旋转
        /// </summary>
        /// <param name="go">旋转的物体</param>
        /// <param name="space">旋转相对坐标系</param>
        /// <param name="axisLimit">限制于某轴</param>
        /// <param name="minangle">限制于某轴上最小角度</param>
        /// <param name="maxangle">限制于某轴上最大角度</param>
        //public static void StartGoRotate(GameObject go, Space space = Space.World, AxisLimits axisLimit = AxisLimits.None, float minangle = -360, float maxangle = 360)
        //{
        //    RotateAndZoomManager.StartGoRotate(go, space, axisLimit, minangle, maxangle);
        //}

        /// <summary>
        /// 关闭物体旋转
        /// </summary>
        //public static void StopGoRotate(GameObject go)
        //{
        //    RotateAndZoomManager.StopGoRotate(go);
        //}

        #endregion


        #region 相机缩放开启与关闭

        /// <summary>
        /// 开启相机缩放
        /// </summary>
        /// <param name="center">缩放中心</param>
        /// <param name="mindistance">距离中心最近距离</param>
        /// <param name="maxdistance">距离中心最远距离</param>
        public static void StartCameraZoom(Transform center, float mindistance, float maxdistance)
        {
            RotateAndZoomManager.StartCameraZoom(center, mindistance, maxdistance);
        }