/// <summary> /// 开启相机的无限缩放 /// </summary> void StartCameraZoom() { mainCamera = MUtility.MainCamera; //EventCameraZoom.AddListener(HandZoomFun); EventCameraZoom.AddListener(MouseZoomFun); }
/// <summary> /// 开启相机对中心点缩放 /// </summary> /// <param name="zoomcenter">缩放中心</param> /// <param name="mindistance">最近距离</param> /// <param name="maxdistance">最大距离</param> public void StartCameraZoomWithCenter(Transform zoomcenter, float mindistance, float maxdistance) { mainCamera = MUtility.MainCamera;; zoomTarget = zoomcenter; zoomMinDis = mindistance; zoomMaxDis = maxdistance; //EventCameraZoom.AddTwoHandDisEvent(HandZoomFun); EventCameraZoom.AddListener(MouseZoomFun); isEnable = true; isZoomInitialization = true; }
/// <summary> /// 暂停或者重启动 /// </summary> /// <param name="isenable"></param> public void PauseOrRestart(bool isenable) { if (!isZoomInitialization) { return; } if (isenable) { //EventCameraZoom.AddTwoHandDisEvent(HandZoomFun); EventCameraZoom.AddListener(MouseZoomFun); } else { //EventCameraZoom.RemoveTwoHandDisEvent(HandZoomFun); EventCameraZoom.RemoveListener(MouseZoomFun); } }
void ontest() { gameObject.AddGrabObject(onGrab); gameObject.RemoveGrabObject(onGrab); gameObject.RemoveGrabObjectAll(); gameObject.AddReleaseObject(OnRelease); gameObject.RemoveReleaseObject(OnRelease); gameObject.RemoveReleaseObjectAll(); gameObject.AddRayTargetEnter(OnTargetEnter); gameObject.RemoveRayTargetEnter(OnTargetEnter); gameObject.RemoveRayTargetEnter(); gameObject.AddRayTargetExit(OnTargetExit); gameObject.RemoveRayTargetExit(); gameObject.RemoveRayTargetExit(OnTargetExit); EventHandRay.AddListener(onRay); EventHandRay.RemoveListener(onRay); EventHandRays.AddListener(OnRays); EventHandRays.RemoveListener(OnRays); EventHandStart.AddListener(onstart); EventHandStart.RemoveListener(onstart); EventHandStop.AddListener(onstop); EventHandStop.RemoveListener(onstop); EventHandUIRay.AddListener(onRay); EventHandUIRay.RemoveListener(onRay); EventCameraZoom.AddListener(onzoom); EventCameraZoom.RemoveListener(onzoom); EventCameraRotate.AddListener(onrotate); EventCameraRotate.RemoveListener(onrotate); EventHandGrabObject.AddListener(ongrabobject); EventHandGrabObject.RemoveListener(ongrabobject); EventHandReleaseObject.AddListener(onreleaseobject); EventHandReleaseObject.RemoveListener(onreleaseobject); EventHandGrabObjectKey.AddListener(gameObject, onGrab); EventHandGrabObjectKey.RemoveListener(gameObject, onGrab); EventHandReleaseObjectKey.AddListener(gameObject, OnRelease); EventHandReleaseObjectKey.RemoveListener(gameObject, OnRelease); EventHandRayTarget.AddListener(onraytarget); EventHandRayTarget.RemoveListener(onraytarget); EventHandRayTargetEnter.AddListener(gameObject, OnTargetEnter); EventHandRayTargetEnter.RemoveListener(gameObject, OnTargetEnter); EventHandRayTargetExit.AddListener(gameObject, OnTargetExit); EventHandRayTargetExit.RemoveListener(gameObject, OnTargetExit); EventHandUIRayEnter.AddListener(gameObject, onuienter); EventHandUIRayEnter.RemoveListener(gameObject, onuienter); EventHandUIRayExit.AddListener(gameObject, onuiexit); EventHandUIRayExit.RemoveListener(gameObject, onuiexit); EventHandUIRay.AddListener(onRay); EventHandUIRay.RemoveListener(onRay); }