[Resolved] new visual components not exposed in UnityEngine.dll?

I’m running into an issue with uGUI components and Visual Studio. In my project, I added a few UI elements and a text object to the scene, and I’m trying to change the text string programmatically - but the compiler doesn’t recognize the Text component.

For example, a line like this:
Text text = myobject.GetComponent();
won’t compile, because the Text class can’t be resolved.

Example code from Unity suggests the Text component lives inside the UnityEngine.UI namespace. But inspecting UnityEngine.dll, the Text class isn’t exposed, and in fact, I don’t see anything from the UnityEngine.UI namespace at all. It looks like the only uGUI classes that are exposed, are the ones in the base UnityEngine namespace, like Canvas or RectTransform.

So two questions:

  1. The Text class and other UnityEngine.UI classes should be showing up in UnityEngine.dll in Visual Studio, right? That seems like a bug.
  2. Until that’s fixed, is there a reasonable workaround I can use to set a text field?

It is in: UnityEngine.UI.dll

2 Likes

Ah, thank you!

FWIW, I looked for additional DLLs inside Unity\Editor\Data\Managed, but didn’t find any. It turns out that one lives under Unity\Editor\Data\UnityExtensions\Unity\GUISystem\4.6.0 instead.