Search Unity

2019.4.8f1 - Moving from UnityEngine.UI to something else? What?!

Discussion in 'UGUI & TextMesh Pro' started by redmotion_games, Jan 24, 2021.

  1. redmotion_games

    redmotion_games

    Joined:
    May 6, 2013
    Posts:
    84
    I've been trying to resurrect an old 2d project that predominantly used UnityEngine.UI.

    2019.4 has some features I can't do without in regards to it's innerworking as I'm rebuilding the main code from scratch.

    So in 2021, what should I use for Canvas located UI text?

    Seems I can no longer use "using UnityEngine.UI" in my code. That would have been so easy. Why does Unity let you add UnityEngine.UI Text in the Editor but deny access to it in code?!!

    All I need to do is access the text and update it on occassion. No flashy animations or colour changes.

    Any help would be most helpful. Thanks
     
  2. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    I use 2021 and UnityEngine.UI works fine for me - have you added "Unity UI" package in Package Manager?
     
  3. redmotion_games

    redmotion_games

    Joined:
    May 6, 2013
    Posts:
    84
    Yes, thanks for your input.

    Unity UI Package 1.0.0 (verified for 2019.4) is there.

    I think it's Visual Studio Code that's the problem. The IntelliSense keeps breaking. All the text occasionally goes random colors and perfectly working code throws errors but still compiles fine in Unity. Various fixes work

    I've re-updated the VSC package to the verified version, regenerated project files in the Project settings, reloaded the project.

    And now it's letting me add:

    using TMPro;

    which is also allowing me to add:

    public TextMeshProUGUI SDE_Button_Number_Text;

    now, without the type TextMeshProUGUI throwing an error.

    Doesn't fix the Unity.UI issue - but I just need a reliable text system!
     
    Last edited: Jan 24, 2021
    adamgolden likes this.