您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
75 行
2.0 KiB
75 行
2.0 KiB
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEngine.Experimental.Rendering
|
|
{
|
|
public class Debugging : MonoBehaviour
|
|
{
|
|
private static List<string> m_DebugMessages = new List<string>();
|
|
|
|
|
|
public static void PushDebugMessage(string message)
|
|
{
|
|
m_DebugMessages.Add(message);
|
|
}
|
|
|
|
static public bool CheckRequiredInputButtonMapping(string[] values)
|
|
{
|
|
bool inputsOk = true;
|
|
foreach (string value in values)
|
|
{
|
|
try
|
|
{
|
|
Input.GetButton(value);
|
|
}
|
|
catch
|
|
{
|
|
Debug.LogError(string.Format("Required input button mapping missing: {0}.", value));
|
|
inputsOk = false;
|
|
}
|
|
}
|
|
|
|
return inputsOk;
|
|
}
|
|
|
|
static public bool CheckRequiredInputAxisMapping(string[] values)
|
|
{
|
|
bool inputsOk = true;
|
|
foreach (string value in values)
|
|
{
|
|
try
|
|
{
|
|
Input.GetAxis(value);
|
|
}
|
|
catch
|
|
{
|
|
Debug.LogWarning(string.Format("Required input axis mapping missing: {0}.", value));
|
|
inputsOk = false;
|
|
}
|
|
}
|
|
|
|
return inputsOk;
|
|
}
|
|
|
|
|
|
void OnGUI()
|
|
{
|
|
using (new GUILayout.HorizontalScope())
|
|
{
|
|
GUILayout.Space(10.0f);
|
|
using (new GUILayout.VerticalScope())
|
|
{
|
|
GUILayout.Space(10.0f);
|
|
for (int i = 0; i < m_DebugMessages.Count; ++i)
|
|
{
|
|
GUILayout.Label(m_DebugMessages[i]);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Make sure to clear only after all relevant events have occured.
|
|
if (Event.current.type == EventType.Repaint)
|
|
m_DebugMessages.Clear();
|
|
}
|
|
}
|
|
}
|