public void Record() { float idlePitchValue = 0; int count = 0; for (int i = 0; i < 100; i++) { idlePitchValue += pitchController.GetPitch(); count++; pitchValue.text = Mathf.Round(idlePitchValue / count).ToString(); } manager.IdleThreshold = Mathf.Round(idlePitchValue / count) * 1.5; }
void CharacterControl() { var pitchValue = pitchController.GetPitch(); if (pitchValue > 150 + manager.IdleThreshold) { model.player.nextMoveCommand = Vector3.left * stepSize; } else { model.player.nextMoveCommand = Vector3.right * stepSize; } }