Exemplo n.º 1
0
//         public void OnMove() {
//             if (clickTarget != null) {//取消按下事件, click事件无效
//                 GameObject nowTarget = ClickScene();
//                 if (nowTarget != clickTarget) {
//                     EventMultiArgs args = new EventMultiArgs();
//                     args.AddArg("target", clickTarget);
//                     EventSystem.CallEvent(EventID.PRESS_CANCEL_SCENE_TARGET, args, true);
//                     clickTarget = null;
//                 }
//             }
//         }

        public MovePathMono AddCameraPath(string pathName, bool willResetPos = true, DragCameraByPath.EDragType eType = DragCameraByPath.EDragType.MOMENTUM, List <float> listPagePoint = null)
        {
            if (movePath != null && movePath.PathName == pathName)
            {
                return(null);
            }
            GameObject camObj = _sceneCamera;

            if (camObj == null)
            {
                return(null);
            }

            //movePath = camObj.GetComponent<MovePathMono>();
            //if (movePath != null)
            //    RemoveCameraPath();

            movePath = camObj.AddComponent <MovePathMono>();

            movePath.CreatePath(pathName);
            SetCameraDragble(movePath, fCurCameraPos, eType, listPagePoint);//给镜头拖动表现指定轨迹
            if (willResetPos)
            {
                sceneCamera.transform.position = movePath.GetPointAtTime(fCurCameraPos);
                movePath.UpdateRotation();
                OnDragScene(fCurCameraPos);
            }

            return(movePath);
        }
Exemplo n.º 2
0
 public void AddAllPathToCamera(GameObject camObj)
 {
     init();
     foreach (KeyValuePair <string, PathConfig> keyValue in dicPathCofig)
     {
         string       pathName = keyValue.Key;
         MovePathMono movePath = camObj.AddComponent <MovePathMono>();
         movePath.CreatePath(pathName);
         movePath.enabled = false;
     }
 }
Exemplo n.º 3
0
        public MovePathMono AddCameraPath(string pathName, PathConfig config, DragCameraByPath.EDragType eType = DragCameraByPath.EDragType.MOMENTUM, List <float> listPagePoint = null)
        {
            GameObject camObj = _sceneCamera;

            if (camObj == null)
            {
                return(null);
            }

            movePath = camObj.GetComponent <MovePathMono>();
            if (movePath != null)
            {
                RemoveCameraPath();
            }

            movePath = camObj.AddComponent <MovePathMono>();
            movePath.CreatePath(pathName, config);
            sceneCamera.transform.position = movePath.GetPointAtTime(fCurCameraPos);
            movePath.UpdateRotation();
            SetCameraDragble(movePath, fCurCameraPos, eType, listPagePoint);//给镜头拖动表现指定轨迹
            OnDragScene(fCurCameraPos);

            return(movePath);
        }