private static void Update() { RaycastHit hit; if (TouchConst.TouchBegin()) { TouchConst.times = DateTime.Now; mRay = Camera.main.ScreenPointToRay(Input.mousePosition); if (IsAllow(out hit)) { mClickName = hit.collider.name; } } if (TouchConst.TouchEnd()) { if (IsAllow(out hit)) { if (hit.collider.name.Contains(mClickName)) { mClickName = string.Empty; Debug.Log(hit.point); } } } else if (TouchConst.TouchIng()) { } else if (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Moved) { } }
private void OnUpate() { if (!mLArea) { return; } if (!mAreaBg) { return; } if (!mCircle) { return; } Vector2 inputPos = TouchConst.TouchPosition(); if (!mIsClickArea && TouchConst.TouchBegin()) { if (inputPos.x >= 0 && inputPos.x < Offset.x * 2 && inputPos.y > 0 && inputPos.y < Offset.y * 2) { mIsClickArea = true; } } if (!mIsClickArea) { return; } if (TouchConst.TouchIng()) { KeyboardControl.IsRestrict = true; if (!mLArea.gameObject.activeSelf) { mLArea.gameObject.SetActive(true); } UpdateAreaBgPos(inputPos); UpdateCirclePos(inputPos); //UnitMgr.Instance.SetPlayerMove(true); //if (mPlayer != null) // RemoteControl.Instance.ExecuteMove(mPlayer.CTemp.id); } else if (TouchConst.TouchEnd()) { //if(mPlayer != null) // RemoteControl.Instance.UndoMove(mPlayer.CTemp.id); //UnitMgr.Instance.SetPlayerMove(false); mIsFixedPos = false; mIsClickArea = false; if (mLArea.gameObject.activeSelf) { mLArea.gameObject.SetActive(false); } KeyboardControl.IsRestrict = false; } }
private void OnUpate() { if (!mLArea) { return; } if (!mAreaBg) { return; } if (!mCircle) { return; } Vector2 inputPos = TouchConst.TouchPosition(); if (!mIsClickArea && TouchConst.TouchBegin()) { if (inputPos.x >= 0 && inputPos.x < Offset.x * 2 && inputPos.y > 0 && inputPos.y < Offset.y * 2) { mIsClickArea = true; } } if (!mIsClickArea) { return; } if (TouchConst.TouchIng()) { if (!mLArea.gameObject.activeSelf) { mLArea.gameObject.SetActive(true); } UpdateAreaBgPos(inputPos); UpdateCirclePos(inputPos); } else { mIsFixedPos = false; mIsClickArea = false; if (mLArea.gameObject.activeSelf) { mLArea.gameObject.SetActive(false); } } }