// Update is called once per frame void Update() { if (Temp_OBJ != null && NewOBJ) { // float a = CRLuo.mainMeshRender.renderer.bounds.center.y // + CRLuo.mainMeshRender.renderer.bounds.extents.y + CRLuo.OneShow_Height; CameraOBJ.transform.localPosition = new Vector3(CRLuo.ScaleplateOffset.x, CRLuo.mainMeshRender.renderer.bounds.center.y + CRLuo.ScaleplateOffset.y, cameraPosz + CRLuo.ScaleplateOffset.z); // a = a * Screen.height / Screen.width + CameraAdd; // float b = Mathf.Abs( CameraOBJ.transform.localPosition.z); // // float TempFOV = (Mathf.Atan (a / b) * 180 / Mathf.PI * 2); // CameraOBJ.fieldOfView = TempFOV; NewOBJ = false; } if (Input.GetMouseButtonDown(0)) { MiniItween.DeleteType(StageOBJ, MiniItween.Type.Rotate); Touch_O = Input.mousePosition; NowRotation = StageOBJ.transform.rotation.eulerAngles; if (Temp_OBJ != null) { if (CRLuo.GetCurAnim() == "Idle") { if (AW.Utils.UnityUtils.inScreenRect(CRLuo.mainMeshRender, CameraOBJ, Input.mousePosition)) { lastBtnDown = Time.realtimeSinceStartup; playAnim(); } } } } else if (Input.GetMouseButton(0)) { MiniItween.DeleteType(StageOBJ, MiniItween.Type.Rotate); Vector2 NewPos = Input.mousePosition; float NowLong = NewPos.x - Touch_O.x; NowLong *= RotSheepScale; StageOBJ.transform.rotation = Quaternion.Euler(new Vector3(0, NowRotation.y - NowLong, 0)); } if ((Time.realtimeSinceStartup - lastBtnDown) >= AUTO_TIME) { lastBtnDown = Time.realtimeSinceStartup; playAnim(); } }
void Update() { if (Input.GetKeyDown(KeyCode.Alpha1) || Input.GetKeyDown(KeyCode.Alpha2) || Input.GetKeyDown(KeyCode.Alpha3) || Input.GetKeyDown(KeyCode.Alpha4) || Input.GetKeyDown(KeyCode.Alpha5) || Input.GetKeyDown(KeyCode.Alpha6) || Input.GetKeyDown(KeyCode.Alpha7) || Input.GetKeyDown(KeyCode.Alpha8) || Input.GetKeyDown(KeyCode.Alpha9) || Input.GetKeyDown(KeyCode.Alpha0)) { Init(); Debug.LogWarning("Ready"); } if (Input.GetKeyDown(KeyCode.P)) { Take(); Debug.Break(); } else if (Input.GetKeyDown(KeyCode.O)) { Take(); } if (lastAnimName == "") { lastAnimName = go_Attacker.GetCurAnim(); } else if (lastAnimName != go_Attacker.GetCurAnim()) { lastAnimName = go_Attacker.GetCurAnim(); Init(); index = 0; } }