Version: 2020.2

GUISkin.verticalSliderThumb

切换到手册
public GUIStyle verticalSliderThumb ;

描述

GUI.VerticalSlider 控件中用于拖动的滑块默认使用的样式。

padding 属性用于确定滑块的大小。

using UnityEngine;

public class Example : MonoBehaviour { // Modifies only the vertical slider thumb style of the current GUISkin

float vSliderValue = 0.0f; GUIStyle style;

void OnGUI() { GUI.skin.verticalSliderThumb = style; vSliderValue = GUILayout.VerticalSlider(vSliderValue, 10.0f, 0.0f); } }