// Update is called once per frame void Update() { // キーを押している間 if (Input.anyKey) { // 移動量 float ToRotate = 0f;//Input.GetAxis("Mouse X"); if (Input.GetKeyDown(KeyCode.LeftArrow)) { script.SetTop(script.nowTop, true); ToRotate = -90f; } if (Input.GetKeyDown(KeyCode.RightArrow)) { script.SetTop(script.nowTop, false); ToRotate = 90f; } // float mouseInputY = Input.GetAxis("Mouse Y"); // targetの位置のZ軸を中心に、回転(公転)する switch (script.cameraRotate) { case true: transform.RotateAround(targetPos, Vector3.right, ToRotate); break; case false: transform.RotateAround(targetPos, Vector3.forward, ToRotate); break; } } }
// Update is called once per frame void Update() { // キーを押している間 if (Input.anyKey) { // 移動量 //float ToRotate = 0.0f;//Input.GetAxis("Mouse X"); //========================== // 左にステージが90度傾く //========================== if (Input.GetKeyDown(KeyCode.RightArrow)) { //trueで左回転 script.SetTop(script.nowTop, true); StartCoroutine(MoveL()); script.operations(-1); } //========================== // 右にステージが90度傾く //========================== if (Input.GetKeyDown(KeyCode.LeftArrow)) { //falseで右回転 script.SetTop(script.nowTop, false); StartCoroutine(MoveR()); script.operations(-1); } } }
// Update is called once per frame void Update() { // キーを押している間 if (Input.anyKey) { // 移動量 float ToRotate = 0.0f;//Input.GetAxis("Mouse X"); //========================== // 左にステージが90度傾く //========================== if (Input.GetKeyDown(KeyCode.RightArrow)) { //trueで左回転 script.SetTop(script.nowTop, true); ToRotate = -90.0f; script.operations(-1); } //========================== // 右にステージが90度傾く //========================== if (Input.GetKeyDown(KeyCode.LeftArrow)) { //falseで右回転 script.SetTop(script.nowTop, false); ToRotate = 90.0f; script.operations(-1); } // float mouseInputY = Input.GetAxis("Mouse Y"); // targetの位置のZ軸を中心に、回転(公転)する switch (script.cameraRotate) { //カメラがX軸上にある場合 case true: transform.RotateAround ( Center.transform.position, Vector3.right, ToRotate ); break; //カメラがZ軸上にある場合 case false: transform.RotateAround ( Center.transform.position, Vector3.forward, ToRotate ); break; } } }
// Update is called once per frame void Update() { // キーを押している間 if (Input.anyKey) { // 移動量 //float ToRotate = 0.0f;//Input.GetAxis("Mouse X"); ////========================== //// Z軸で左にステージが90度傾く ////========================== //if (Input.GetKeyDown(KeyCode.RightArrow) && script.isCamera == false && script.isRotate == false) //{ // //trueで左回転 // script.SetTop(script.nowTop, true); // StartCoroutine(MoveL()); // script.operations(-1); //} ////========================== //// Z軸で右にステージが90度傾く ////========================== //if (Input.GetKeyDown(KeyCode.LeftArrow) && script.isCamera == false && script.isRotate == false) //{ // //falseで右回転 // script.SetTop(script.nowTop, false); // StartCoroutine(MoveR()); // script.operations(-1); //} //========================== // Y軸で左にステージが90度傾く //========================== if (BottunScriptL.isClicked == true && script.isCamera == false && script.isRotate == false) { //trueで左回転 script.SetTop(script.nowTop, true); StartCoroutine(RollYL()); script.operations(-1); } //========================== // Y軸で右にステージが90度傾く //========================== if (BottunScriptR.isClicked == true && script.isCamera == false && script.isRotate == false) { //falseで右回転 script.SetTop(script.nowTop, false); StartCoroutine(RollYR()); script.operations(-1); } } }