// 重载OnInspectorGUI方法,来绘制控件 public override void OnInspectorGUI() { EditorTest editorTest = (EditorTest)target; // 绘制一个窗口 editorTest.mRectValue = EditorGUILayout.RectField("窗口坐标", editorTest.mRectValue); // 绘制一个贴图槽 editorTest.texture = EditorGUILayout.ObjectField("增加一个贴图", editorTest.texture, typeof(Texture), true) as Texture; }
public void CSVEditorTest() { EditorTest et = new EditorTest( "A,B,C,D" + "\r\n" + "E,,F,G" + "\r\n" + "H,,I,J" + "\r\n" + "K,,L,\"M,N\"" + "\r\n" + "\r\n" ); ForLine fl = (Line, nb) => new string[] { Line["A"], Line["D"], Line["B"], "C" }; Edit(et, fl).Wait(); AssertThat.AreEqual(et.Out, IS.a( "A,D,B,C" + "\r\n" + "E,G,,C" + "\r\n" + "H,J,,C" + "\r\n" + "K,\"M,N\",,C" + "\r\n" )); }
static void Test() { window = (EditorTest)EditorWindow.GetWindow(typeof(EditorTest), false); window.Show(); }
static void ExcelT() { EditorTest et = (EditorTest)EditorWindow.GetWindow(typeof(EditorTest), true, "Editor"); et.Show(); }