public void TestSetup() { EventSystem.current = new GameObject("EventSystem", typeof(EventSystem)).GetComponent <EventSystem>(); GameObject canvasRoot = new GameObject("Canvas", typeof(RectTransform), typeof(Canvas)); GameObject SelectableGO = new GameObject("Selectable", typeof(RectTransform), typeof(CanvasRenderer)); SelectableGO.transform.SetParent(canvasRoot.transform); selectable = SelectableGO.AddComponent <SelectableTest>(); selectable.targetGraphic = selectable.gameObject.AddComponent <ConcreteGraphic>(); }