Search Unity

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

Discussion in 'UGUI & TextMesh Pro' started by rzubek, Aug 21, 2014.

  1. rzubek

    rzubek

    Joined:
    Aug 21, 2014
    Posts:
    72
    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<Text>();
    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?
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    It is in: UnityEngine.UI.dll
     
    starkister and rzubek like this.
  3. rzubek

    rzubek

    Joined:
    Aug 21, 2014
    Posts:
    72
    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.