I have a problem with a editor script i am workig on.
Here is the code
using UnityEngine;
using UnityEditor;
public class FindObjects : EditorWindow {
private GameObject texture = null;
// Add menu named "My Window" to the Window menu
[MenuItem ("3dBorat's Editor/Test")]
static void Init () {
// Get existing open window or if none, make a new one:
FindObjects window = (FindObjects)EditorWindow.GetWindow (typeof (FindObjects));
window.maxSize = new Vector2(400, 500);
}
void OnGUI () {
texture = EditorGUI.ObjectField( new Rect(3,3,200,20), "Add a Texture:", texture, Texture);
}
}
I get 3 Errors
Assets/Editor/FindObjects.cs(18,99): error CS0119: Expression denotes a type', where a variable’, value' or method group’ was expected
Assets/Editor/FindObjects.cs(18,37): error CS1502: The best overloaded method match for `UnityEditor.EditorGUI.ObjectField(UnityEngine.Rect, string, UnityEngine.Object, System.Type)’ has some invalid arguments
Assets/Editor/FindObjects.cs(18,37): error CS1503: Argument #4' cannot convert object’ expression to type `System.Type’
The js version works for me but i try to convert it and c# and it not working please help me