- Home /
Question by
W1k3 · Mar 01, 2015 at 08:34 AM ·
c#guieditoreditorwindow
Can't find proper use of objectfield in a custom editor window (C#)
The unity documentation page only has java, and there were 2 errors on line 22. Sorry for such a noob question.
error CS1503: Argument #1' cannot convert
object' expression to type UnityEngine.Rect' error CS0119: Expression denotes a
type', where a variable',
value' or `method group' was expected
using UnityEngine;
using System.Collections;
using UnityEditor;
public class roommanager_window : EditorWindow
{
public static roommanager_window window = null;
public GameObject rooms = null;
public static void Init()
{
window = (roommanager_window)EditorWindow.GetWindow(typeof(roommanager_window), false, "room mngr");
}
void OnGUI()
{
GUILayout.Label("Base Settings", EditorStyles.boldLabel);
rooms = EditorGUI.ObjectField(Rect(3, 3, position.width - 6, 20), "Rooms:", rooms, GameObject);
}
}
Comment