void Update() { if (Input.GetMouseButtonDown(0)) { if (HellgateSceneManagerEx.Instance._UIType == UIType.NGUI) { if (!CameraUtil.GetClickNGUI()) { Create(); } } else { if (!EventSystem.current.IsPointerOverGameObject()) { Create(); } } } }
void Update() { if (Input.GetMouseButtonDown(0)) { if (HellgateSceneManagerEx.Instance._UIType == UIType.NGUI) { if (!CameraUtil.GetClickNGUI()) { inputFlag = true; } } else { if (!EventSystem.current.IsPointerOverGameObject()) { inputFlag = true; } } } if (inputFlag) { pos = Input.mousePosition; pos.y += 20f; pos = Camera.main.ScreenToWorldPoint(pos); } float step = speed * Time.deltaTime; // trans.position = Vector3.Lerp (trans.position, pos, step); trans.position = Vector3.MoveTowards(trans.position, pos, step); if (Input.GetMouseButtonUp(0)) { inputFlag = false; } }