IEnumerator KeyPad() { Vector3 Stick; while (this.gameObject.activeInHierarchy == true) { Stick = InputManager_JHW.MainJoystick(); if (Stick.x < 0) { source.clip = clips[2]; source.Play(); index = 0; } if (Stick.x > 0) { source.clip = clips[2]; source.Play(); index = 1; } for (int i = 0; i < Select.Length; ++i) { Select[i].SetActive(false); } Select[index].SetActive(true); yield return(new WaitForSeconds(0.125f)); } }
IEnumerator KeyPad() { while (gameObject.activeSelf) { Vector3 Stick; Stick = InputManager_JHW.MainJoystick(); if (Stick.x > 0) { choice = false; } else if (Stick.x < 0) { choice = true; } if (choice) { ui_arr[0].gameObject.SetActive(true); ui_arr[1].gameObject.SetActive(false); } else { ui_arr[1].gameObject.SetActive(true); ui_arr[0].gameObject.SetActive(false); } yield return(new WaitForSeconds(0.05f)); } }
IEnumerator logicMove() { while (skillFollower.IsConfirm()) { Vector3 Stick; Stick = InputManager_JHW.MainJoystick(); if (Stick.z > 0.3f || Stick.x > 0.3f) { source.Play(); ++selectSkill; if (selectSkill >= 5) { selectSkill = 0; } yield return(new WaitForSeconds(1.0f)); } else if (Stick.z < -0.3f || Stick.x < -0.3f) { source.Play(); --selectSkill; if (selectSkill <= -1) { selectSkill = 4; } yield return(new WaitForSeconds(1.0f)); } yield return(new WaitForSeconds(.1f)); } cor = false; }
// Update is called once per frame void Update() { time += Time.deltaTime; //Vector3 vec = test.transform.position - transform.position; //vec.Normalize(); //Quaternion rotate = Quaternion.LookRotation(vec); //transform.rotation = rotate; //transform.LookAt(test.transform); // transform.Translate(InputManager_JHW.MainJoystick() * Time.deltaTime); Vector3 pos = InputManager_JHW.MainJoystick(); Vector3 right; Vector3 moveDir = new Vector3(); Vector3 forword; //if (InputManager_JHW.AButton()) //{ // transform.Rotate(0, 10, 0); //} //Vector3 rota = InputManager_JHW.SubJoystick(); //rota.y = rota.x; //rota.x = 0.0f; //rota.z = 0.0f; // Vector3 char_pos = transform.position; // transform.Translate(new Vector3(0.0f,0.0f,0.0f)); // transform.Rotate(rota); // transform.Translate(char_pos); if (Singletone.Instance.Hor != 0 || Singletone.Instance.Ver != 0) { forword = player.transform.TransformDirection(Vector3.forward); forword.y = 0; forword = forword.normalized; right = new Vector3(forword.z, 0, -forword.x); moveDir = Singletone.Instance.Hor * right + Singletone.Instance.Ver * forword; //Dir = Vector3.forward * Singletone.Instance.Ver + Vector3.right * Singletone.Instance.Hor; //transform.rotation = Quaternion.LookRotation(Dir); Singletone.Instance.Hor = 0; Singletone.Instance.Ver = 0; } if (moveDir != Vector3.zero) { time = 0.0f; moveDir = moveDir.normalized; transform.position -= moveDir * Time.deltaTime * 6.5f; } //Vector3 pos = tt.position; //pos.y = 0; //transform.position=pos; }
//우리 방식 void MoveTouchPad() { Vector3 touchDir = InputManager_JHW.MainJoystick() * 2; if (touchDir.magnitude > 0.0f) { Vector3 camdir = camTr.TransformDirection(Vector3.forward); Vector3 dir = camdir + touchDir; dir.Normalize(); Vector3 moveDir = camTr.TransformDirection(dir); cc.SimpleMove(moveDir * speed); body.Play("Fastmove"); } }
//우리 방식 void MoveTouchPad() { Vector3 touchDir = InputManager_JHW.MainJoystick(); //if ((touchDir.magnitude > 0.0f) && !move) if (touchDir.magnitude > 0.0f) { Vector3 camdir = camTr.TransformDirection(Vector3.forward); Vector3 dir = camdir + touchDir; dir.Normalize(); Vector3 moveDir = camTr.TransformDirection(dir); //transform.position += moveDir * 2; //move = true; cc.SimpleMove(moveDir * speed); } //else move = false; }
void Update() { // mCamera.transform.LookAt(transform.position); //mCamera.transform.RotateAround(transform.position, Vector3.up, transform.rotation.z); //transform.rotation = CameraRig.transform.rotation; //Transform root =cc.trackingSpace; //Transform centerEye =cc.centerEyeAnchor; //if (HmdRotatesY) //{ // Vector3 prevPos = root.position; // Quaternion prevRot = root.rotation; // transform.rotation = Quaternion.Euler(0.0f, centerEye.rotation.eulerAngles.y, 0.0f); // root.position = prevPos; // root.rotation = prevRot; //} transform.Translate(InputManager_JHW.MainJoystick() * Time.deltaTime); //transform.position = CameraRig.transform.position; // transform.Translate(Time.deltaTime * 1, 0, 0); }
IEnumerator KeyPad() { if (!confirm) { Vector3 Stick; while (this.gameObject.activeInHierarchy) { //KeyBoard Stick = InputManager_JHW.MainJoystick(); if (Stick.x > 0) { if (index != 2 && index != 3) { index++; source.clip = clips[2]; source.Play(); } } if (Stick.x < 0) { if (index != 0 && index != 3) { index--; source.clip = clips[2]; source.Play(); } } for (int i = 0; i < Select.Length; ++i) { Select[i].SetActive(false); } Select[index].SetActive(true); yield return(new WaitForSeconds(0.125f)); } } }
void Update() { ////Vector3 vec = test.transform.position - transform.position; ////vec.Normalize(); ////Quaternion rotate = Quaternion.LookRotation(vec); ////transform.rotation = rotate; //if (InputManager_JHW.AButton()) //{ // transform.Rotate(0, 30, 0); //} ////transform.LookAt(test.transform); //// transform.Translate(InputManager_JHW.MainJoystick() * Time.deltaTime); //Vector3 pos = InputManager_JHW.MainJoystick(); //Vector3 right; //Vector3 moveDir=new Vector3(); //Vector3 forword; //if (Singletone.Instance.Hor != 0 || Singletone.Instance.Ver!=0) //{ // forword = transform.TransformDirection(Vector3.forward); // forword.y = 0; // forword = forword.normalized; // right = new Vector3(forword.z, 0, -forword.x); // moveDir = Singletone.Instance.Hor * right + Singletone.Instance.Ver * forword; // //Dir = Vector3.forward * Singletone.Instance.Ver + Vector3.right * Singletone.Instance.Hor; // //transform.rotation = Quaternion.LookRotation(Dir); // Singletone.Instance.Hor = 0; // Singletone.Instance.Ver = 0; //} //if (moveDir != Vector3.zero) //{ // moveDir = moveDir.normalized; // transform.position = moveDir; //} transform.position = InputManager_JHW.MainJoystick(); }
IEnumerator KeyPad() { while (true) { if (!confirm) { Vector3 Stick; Stick = InputManager_JHW.MainJoystick(); if (Stick.x > 0) { if (myposit.x < 2) { source.clip = clips[2]; source.Play(); myposit.x++; } } if (Stick.x < 0) { if (myposit.x > 0) { source.clip = clips[2]; source.Play(); myposit.x--; } } if (Stick.z > 0) { { source.clip = clips[2]; source.Play(); myposit.y = 1; } } if (Stick.z < 0) { { source.clip = clips[2]; source.Play(); myposit.y = -1; } } if (Vector2.Distance(myposit, new Vector2(-1, 1)) < 0.1f) { index = 0; } else if (Vector2.Distance(myposit, new Vector2(0, 1)) < 0.1f) { index = 0; } else if (Vector2.Distance(myposit, new Vector2(1, 1)) < 0.1f) { index = 1; } else if (Vector2.Distance(myposit, new Vector2(2, 1)) < 0.1f) { index = 2; } else if (Vector2.Distance(myposit, new Vector2(-1, -1)) < 0.1f) { index = 3; } else if (Vector2.Distance(myposit, new Vector2(0, -1)) < 0.1f) { index = 3; } else if (Vector2.Distance(myposit, new Vector2(1, -1)) < 0.1f) { index = 5; } else if (Vector2.Distance(myposit, new Vector2(2, -1)) < 0.1f) { index = 6; } for (int i = 0; i < 7; ++i) { ui_arr[i].SetActive(false); if (i == index) { selMenu = Menus[i]; ui_arr[i].SetActive(true); continue; } } yield return(new WaitForSeconds(0.05f)); } yield return(new WaitForSeconds(0.05f)); } }
IEnumerator KeyPad() { Vector3 Stick; while (this.gameObject.activeInHierarchy == true) { if (timer < 1.0f) { timer += Time.deltaTime * 25; } Stick = InputManager_JHW.MainJoystick(); if (index < 2) { if (Stick.z > 0) { index = 0; source.Play(); } if (Stick.z < 0) { index = 1; source.Play(); } } else if (index == 4 || index == 3) { if (Stick.z > 0) { index = 3; source.Play(); } if (Stick.z < 0) { index = 4; source.Play(); } } else if (11 <= index && index <= 13) { if (Stick.x > 0 && index < 13) { index++; source.Play(); } if (Stick.x < 0 && index > 11) { index--; source.Play(); } } else if (21 <= index && index <= 23) { if (Stick.x > 0 && index < 23) { index++; source.Play(); } if (Stick.x < 0 && index > 21) { index--; source.Play(); } } else if (30 <= index && index <= 33) { if (Stick.x > 0 && index < 33) { index++; source.Play(); } if (Stick.x < 0 && index > 30) { index--; source.Play(); } } for (int i = 0; i < Select.Length; ++i) { Select[i].SetActive(false); } if (index < 5) { Select[index].SetActive(true); for (int i = 0; i < 3; ++i) { Box[i].SetActive(false); Box2[i].SetActive(false); } for (int i = 0; i < 4; ++i) { GrapicBox[i].SetActive(false); } } for (int i = 0; i < 3; ++i) { Box[i].SetActive(false); Box2[i].SetActive(false); } for (int i = 0; i < 4; ++i) { GrapicBox[i].SetActive(false); } if (11 <= index && index <= 13) { Box[index - 11].SetActive(true); } if (21 <= index && index <= 23) { Box2[index - 21].SetActive(true); } if (30 <= index && index <= 33) { GrapicBox[index - 30].SetActive(true); } yield return(new WaitForSeconds(0.125f)); } }
IEnumerator SkillSet() { bool flug = false; while (true) { if (Select == menu.SelectMenu) { Vector3 Stick; Stick = InputManager_JHW.MainJoystick(); if (left == false && right == false) { if (Stick.x > 0) { source.clip = clips[2]; source.Play(); if (stage >= 5) { flug = true; left = true; RotationSkill++; if (RotationSkill == 5) { RotationSkill = 0; } for (int i = 0; i < Skill.Capacity; ++i) { Skill[i].SetActive(false); } } else { ++RotationSkill; if (RotationSkill >= stage) { --RotationSkill; } else { flug = true; left = true; if (RotationSkill == 5) { RotationSkill = 0; } for (int i = 0; i < Skill.Capacity; ++i) { Skill[i].SetActive(false); } } } } if (Stick.x < 0) { source.clip = clips[2]; source.Play(); if (stage >= 5) { flug = true; right = true; RotationSkill--; if (RotationSkill == -1) { RotationSkill = 4; } for (int i = 0; i < Skill.Capacity; ++i) { Skill[i].SetActive(false); } } else { --RotationSkill; if (RotationSkill < 0) { RotationSkill = 0; } else { flug = true; right = true; for (int i = 0; i < Skill.Capacity; ++i) { Skill[i].SetActive(false); } } } } } else { if (flug) { flug = false; StartCoroutine(RotateSkill()); Skill[RotationSkill].SetActive(true); } } } yield return(new WaitForSeconds(0.1f)); } }