Version: 2017.2
public Experimental.UIElements.Slider.Direction direction ;

描述

滑动条的方向,从最小值到最大值。

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class Example : MonoBehaviour { public Slider mainSlider;

public void Start() { //Changes the direction of the slider. if (mainSlider.direction == Slider.Direction.BottomToTop) { mainSlider.direction = Slider.Direction.TopToBottom; } } }