疫情期间家里粮食有限为了减少消耗不费话了,直接上代码.
效果截图:
使用方法:把OpenGLVersion.cs挂载在任何可以挂载的地方.?
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OpenGLVersion : MonoBehaviour
{
private GUIStyle _GUIStyle;
System.Text.StringBuilder info = new System.Text.StringBuilder();
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnGUI()
{
if (_GUIStyle == null)
{
_GUIStyle = new GUIStyle();
_GUIStyle.normal.background = null;
_GUIStyle.normal.textColor = new Color(1.0f, 0.5f, 0.0f);
_GUIStyle.fontSize = 28;
}
GUI.Label(new Rect(0, 50, 500, 200), "OpenGLVersion: " + OpenGLVersion.GetOpenGL(), _GUIStyle);
}
public static string GetOpenGL()
{
return SystemInfo.graphicsDeviceVersion;
}
}
|