Unity在屏幕上绘制一个矩形框
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GUIClass_Test : MonoBehaviour {
// 用于测试GUI
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
private void OnGUI()
{
GUI.backgroundColor = Color.blue;
GUI.color = Color.yellow;
GUI.Box(new Rect(20, 20, 200, 250), "我帮你绘制了个 Rect Box");
}
}
Unity中的GUI矩形绘制示例
文章介绍了如何在Unity中使用OnGUI方法和GUI函数绘制一个蓝色背景、黄色文字的矩形框,展示了基本的GUI控件使用。
3092

被折叠的 条评论
为什么被折叠?



