// Update is called once per frame void Update() { if (Input.GetMouseButtonUp(0)) { if (!StaticGlobal.DraggingPot) { flagMouseDown = false; //根据抬起位置和时间进行手势判断,之后就能用得到的手势结果了 _swipeManager.mouseUp(Input.mousePosition); //炸开状态 不响应滑动操作 if (!clickedTool && !isExploded) { UpdateTools(-_swipeManager.SwipeLR, _swipeManager.ProgressLR); } } StaticGlobal.DraggingPot = false; clickedTool = false; } if (!StaticGlobal.DraggingPot) { ////////////////////////手势的准备工作------------------------ if (Input.GetMouseButtonDown(0)) { _swipeManager.mouseDown(Input.mousePosition); flagMouseDown = true; } ///---------------------------///////////////////////////// //手指未离开屏幕 炸开状态 不响应滑动操作 if (!clickedTool && flagMouseDown && !isExploded) { _swipeManager.CurrentPos = Input.mousePosition; /////////开始根据 progressLR 实时更新壶的位置 和诗句 的透明度 MoveTools(-_swipeManager.RawSwipeLR, _swipeManager.ProgressLR); //把 front壶 的x坐标保存到全局, 以让indicator进行对应的移动 float frontPotX = Tools[_frontToolIndex].transform.position.x; } // indicatorProgress范围 0 ~1 // StaticGlobal.indicatorProgress=(1+_swipeManager.ProgressLR*_swipeManager.RawSwipeLR)/2; } }
// Update is called once per frame void Update() { _intros[_frontIndex].transform.localPosition = Tool.Interpolate(_intros[_frontIndex].transform.position, new Vector3(-Input.acceleration.x * 0.2f, -Input.acceleration.y * 0.2f + introY, 0) , 0.1f); /* _intros[_frontIndex].transform.localRotation=Quaternion.Euler(new Vector3( * -Input.acceleration.y*20,Input.acceleration.x*25,0));*/ ////////////////////////手势的准备工作------------------------ if (Input.GetMouseButtonUp(0)) { if (!StaticGlobal.DraggingPot) { _flagMouseDown = false; //根据抬起位置和时间进行手势判断,之后就能用得到的手势结果了 _swipeManager.mouseUp(Input.mousePosition); UpdateElements(_swipeManager.SwipeLR, _swipeManager.ProgressLR); } StaticGlobal.DraggingPot = false; } if (!StaticGlobal.DraggingPot) { if (Input.GetMouseButtonDown(0)) { _swipeManager.mouseDown(Input.mousePosition); _flagMouseDown = true; } ///---------------------------///////////////////////////// //手指未离开屏幕 if (_flagMouseDown) { _swipeManager.CurrentPos = Input.mousePosition; /////////开始根据 progressLR 实时更新壶的位置 和诗句 的透明度 //MovePotsAndPoem(_swipeManager.RawSwipeLR,_swipeManager.ProgressLR); MoveElements(_swipeManager.RawSwipeLR, _swipeManager.ProgressLR); //使用完当前的mousepos再更新lastFrameMousePos _lastFrameMousePos = Input.mousePosition; } } }
// Update is called once per frame void Update() { //_mainTitle.position=new Vector3(Input.acceleration.x/2,Input.acceleration.y/2+3.43f,0); _mainTitle.position = Tool.Interpolate(_mainTitle.position, new Vector3(-Input.acceleration.x * 0.6f, -Input.acceleration.y * 0.6f + 3.43f, 0) , 0.1f); if (Input.GetMouseButtonUp(0)) { if (!StaticGlobal.DraggingPot) { //移动小于0.05个Progress 同时按下抬起在半秒内 判定为点击事件 // 如果点击区域在壶上面 就加载对应场景 if (_swipeManager.ProgressLR < 0.05f && Time.time - _downTime < 0.2f && Input.mousePosition.y > Screen.height / 4 && Input.mousePosition.y < Screen.height / 2) { //将来scene的名字用数字标志 通过_frontIndex来加载对应的Scene StaticGlobal.Spin = true; SceneManager.LoadSceneAsync(_sceneNames[_frontPotIndex]); } flagMouseDown = false; //根据抬起位置和时间进行手势判断,之后就能用得到的手势结果了 _swipeManager.mouseUp(Input.mousePosition); UpdatePots(_swipeManager.SwipeLR, _swipeManager.ProgressLR); //print("fron t "+_frontPotIndex); //print(_swipeManager.SwipeLR); StaticGlobal.indicatorProgress = (float)_frontPotIndex / (float)2; //print(StaticGlobal.indicatorProgress); } StaticGlobal.DraggingPot = false; } if (!StaticGlobal.DraggingPot) { ////////////////////////手势的准备工作------------------------ if (Input.GetMouseButtonDown(0)) { _swipeManager.mouseDown(Input.mousePosition); flagMouseDown = true; _downTime = Time.time; } ///---------------------------///////////////////////////// //手指未离开屏幕 if (flagMouseDown) { _swipeManager.CurrentPos = Input.mousePosition; /////////开始根据 progressLR 实时更新壶的位置 和诗句 的透明度 MovePotsAndPoem(_swipeManager.RawSwipeLR, _swipeManager.ProgressLR); //把 front壶 的x坐标保存到全局, 以让indicator进行对应的移动 float frontPotX = _lines[_frontPotIndex].transform.position.x; StaticGlobal.indicatorProgress = 1 - (float)(frontPotX + 11) / (float)22; } // indicatorProgress范围 0 ~1 // StaticGlobal.indicatorProgress=(1+_swipeManager.ProgressLR*_swipeManager.RawSwipeLR)/2; } }