我有以下
GUI.Label(new Rect(3, 60, 150, 20), "No-speed circle radious: " + PlayerController.circleradious.ToString());
但屏幕上只有No-speed circle radious:
即使我这样做
GUI.Label(new Rect(3, 60, 150, 20), "No-speed circle radious: " + 100);
它是一样的。我无法理解我的错误。
所有代码:
if (GUIEnabled)
{
GUI.Box(new Rect(0, 0, 550, 150), "Movement type : " + movementlabel);
GUI.Label(new Rect(3, 20, 150, 20), "Speed Factor: " + PlayerController.speedFactor.ToString());
PlayerController.speedFactor = GUI.HorizontalSlider(new Rect(160, 25, 350, 20), PlayerController.speedFactor, 0.0F, 100F);
GUI.Label(new Rect(3, 40, 150, 20), "Velocity: " + (player.rigidbody.velocity.magnitude).ToString());
if((PlayerController.movement == PlayerController.MoveType.KinectMovement)|| (PlayerController.movement == PlayerController.MoveType.KeyboardMovement)){
GUI.Label(new Rect(3, 60, 150, 20), "Rotation Factor: " + PlayerController.rotationFactor.ToString());
PlayerController.rotationFactor = GUI.HorizontalSlider(new Rect(160, 65, 350, 20), PlayerController.rotationFactor, 0.0F, 1000F);
GUI.Label(new Rect(3, 80, 150, 20), "Angular Velocity: " + (player.rigidbody.angularVelocity.magnitude).ToString());
}
else if (PlayerController.movement == PlayerController.MoveType.CenterPointKinectWithoutHands) {
GUI.Label(new Rect(3, 60, 150, 20), "No-speed circle radious: " + PlayerController.circleradious.ToString());
print(PlayerController.circleradious);
//PlayerController.circleradious = GUI.HorizontalSlider(new Rect(160, 65, 350, 20), PlayerController.circleradious, 0.0F, 20F);
}
GUI.Label(new Rect(3, 100, 150, 20), "Camera distance: " + mainCamera.transform.position.y);
mainCamera.transform.position = new Vector3(mainCamera.transform.position.x, GUI.HorizontalSlider(new Rect(160, 105, 350, 20), mainCamera.transform.position.y, 0.0F, 100F), mainCamera.transform.position.z);
}
另一个GUI.Label
完美无缺。
答案 0 :(得分:1)
您的矩形可能太小,请尝试以下操作:
GUI.Label(new Rect(3, 60, 500, 20), ...);
或
GUI.Label(new Rect(3, 60, 150, 200), ...);
并设置
GUIStyle.wordWrap = true;