// 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); }
public void SetCameraDragble(MovePathMono _moveMono, float curPos, DragCameraByPath.EDragType eType = DragCameraByPath.EDragType.MOMENTUM, List <float> listPagePoint = null) { //_dragPath = _sceneCamera.GetComponent<DragCameraByPath>(); if (_dragPath == null) { _dragPath = _sceneCamera.AddComponent <DragCameraByPath>(); } _dragPath.SetMovePath(_moveMono);//给镜头拖动表现指定轨迹 _dragPath._onDragEvent = OnDragScene; _dragPath._bDragDirReverse = bDragDirReverse; _dragPath._dragType = eType; _dragPath._pageViewPoints.Clear(); _dragPath._curCameraPos = curPos; if (listPagePoint != null) { for (int i = 0; i < listPagePoint.Count; i++) { _dragPath._pageViewPoints.Add(listPagePoint[i]); } } }
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); }