The API only shows it in java. I get errors in C#. Does this mean I can’t make an intfield in c#? If someone would please explain that to me, that would be great.
it works fine for me, this is the example script from the Unity docs translated into c#. Put it in the Assets/Editor folder (otherwise it won’t work!):
using UnityEngine;
using System.Collections;
using UnityEditor;
// Editor Script that clones the selected GameObject a number of times.
class EditorGUILayoutIntField : EditorWindow {
int clones = 1;
[MenuItem("Examples/Clone Object")]
static void Init() {
EditorWindow window = GetWindow<EditorGUILayoutIntField>();
window.Show();
}
void OnGUI() {
int sizeMultiplier = EditorGUILayout.IntField("Number of clones:", clones);
if(GUILayout.Button("Clone!"))
for(var i = 0; i < clones; i++)
Instantiate(Selection.activeGameObject, Vector3.zero, Quaternion.identity);
}
}