private void ObjectParamUpdate() { if (Input.GetButtonDown("Back Botton")) { switch (input_mode) { case Input_mode.KEYBOARD: input_mode = Input_mode.GAMEPAD; break; case Input_mode.GAMEPAD: input_mode = Input_mode.KEYBOARD; break; default: break; } } switch (input_mode) { case Input_mode.KEYBOARD: transform.rotation = Quaternion.AngleAxis(param.rotation, param.rotateAxis); break; case Input_mode.GAMEPAD: transform.rotation = Quaternion.Euler(param.rotateVec); break; default: transform.rotation = Quaternion.AngleAxis(param.rotation, param.rotateAxis); break; } { if (RUN) { transform.localPosition += param.movement * RUNSPEED; } else { transform.localPosition += param.movement * SPEED; } } param.rotateVec = Vector3.zero; param.SetPos(transform.localPosition); transform.position.Set(transform.position.x, 1.1f, transform.position.z);//後で直す param.ResetMovement(); }
private void ObjectParamUpdate() { switch (Inputmode) { case INPUT_MODE.KEYBORD: transform.rotation = Quaternion.AngleAxis(param.rotation, param.rotateAxis); break; case INPUT_MODE.GAMEPAD: transform.rotation = Quaternion.Euler(param.rotateVec); break; default: transform.rotation = Quaternion.AngleAxis(param.rotation, param.rotateAxis); break; } param.movement.y = 0.0f; if (Contact_Collision) { param.movement = Vector3.zero; } if (param.movement != Vector3.zero) { if (RUN) { transform.localPosition += param.movement * RUNSPEED; } else { transform.localPosition += param.movement * SPEED; } } param.rotateVec = Vector3.zero; param.SetPos(transform.localPosition); transform.position.Set(transform.position.x, 1.1f, transform.position.z);//後で直す param.ResetMovement(); }