私はゲームメニューを作ろうとしています。このためには、私はGUIlayout
とその方法が必要です。しかし、Unity
のように見えますが、このエラーを表示し、GUIlayout
オブジェクトを見つけることができません。Unity3D v5.4 - GUILayoutは存在しません
Assets/scripts/GameManager.cs(38,25): error CS0103: The name `GUIlayout' does not exist in the current context
はマイコード:
using UnityEngine;
using UnityEditor;
using System.Collections;
public class GameManager : MonoBehaviour {
public bool isMenuActive{get;set;}
void Awake() {
isMenuActive = true;
}
void OnGUI(){
const int Width = 300;
const int Height = 200;
if (isMenuActive){
Rect windowRect = new Rect((Screen.width - Width)/2 ,(Screen.height - Height)/2, Width , Height);
GUIlayout.window(0,windowRect,MainMenu,"Main menu");
}
}
private void MainMenu(){
// Debug.Log("menu is displayed");
}
}
任意のアイデア?
ASP.NETの[エラーCS0103]の重複可能性があります(http://stackoverflow.com/questions/5119207/error-cs0103-in-asp-net) –
「GUIlayout」ではなく「GUILayout」である必要があります。 。 (大文字と小文字を区別)Unity 5.4ではOnGUIを使用しないでください。間もなく、そのサポートは中止されます。 UnityUIを使用してください。 –