版本: Unity 6 (6000.0)
语言英语
  • C#

GUI.EndScrollView

建议更改

成功!

感谢您帮助我们提高 Unity 文档的质量。虽然我们无法接受所有提交,但我们确实会阅读用户提出的每个建议更改,并在适用情况下进行更新。

关闭

提交失败

由于某种原因,您的建议更改无法提交。请 <a>稍后重试</a>。感谢您抽出时间帮助我们提高 Unity 文档的质量。

关闭

取消

声明

public static void EndScrollView();

声明

public static void EndScrollView(bool handleScrollWheel);

描述

结束使用对 BeginScrollView 的调用启动的滚动视图。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { // The position on of the scrolling viewport public Vector2 scrollPosition = Vector2.zero;

void OnGUI() { // An absolute-positioned example: We make a scrollview that has a really large client // rect and put it in a small rect on the screen. scrollPosition = GUI.BeginScrollView(new Rect(10, 300, 100, 100), scrollPosition, new Rect(0, 0, 220, 200));

// Make four buttons - one in each corner. The coordinate system is defined // by the last parameter to BeginScrollView. GUI.Button(new Rect(0, 0, 100, 20), "Top-left"); GUI.Button(new Rect(120, 0, 100, 20), "Top-right"); GUI.Button(new Rect(0, 180, 100, 20), "Bottom-left"); GUI.Button(new Rect(120, 180, 100, 20), "Bottom-right");

// End the scroll view that we began above. GUI.EndScrollView(); } }