Search Unity

[Released] ProTips - Tooltip System for UGUI

Discussion in 'Assets and Asset Store' started by zangad, Aug 25, 2015.

  1. almaris

    almaris

    Joined:
    Jan 15, 2016
    Posts:
    4
    I figured it out, the problem was my Canvas Scaler - Reference Pixels Per Unit = 1, This being set to 100 to match your settings in the demo scene fixes the problem with ProTip (but caused some new ones on my end!)

    My apologies for not catching this prior to my question, but thank you for the quick support!
     
  2. alpapan

    alpapan

    Joined:
    Aug 10, 2019
    Posts:
    3
    Hello

    I've been having some issues with the tooltip container staying in a canvas after it has done it's job and interfering with some GetChild code.

    I think it would be safer that the Tooltip container living under the tooltipmanager when it is not being used (rather than just being inactive.

    To do this, the following code in Tooltip.cs will do it and it causes no issues.

    around line 110:

    ```
    // Move the tooltip back under the proper Tooltip Container if it has a different parent.
    GameObject.transform.SetParent(TooltipManager.Instance.TooltipContainer.transform, false);
    // Move the tooltip container under the tooltip manager
    GameObject.transform.parent.SetParent(TooltipManager.Instance.transform, false);
    ```

    many thanks
    a
     
    zangad likes this.
  3. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi alpapan,

    Thanks for the suggestion, I've added it to our to-do list. On the surface, it sounds like this wouldn't cause any issues, but we'll research it and do some extra testing before adding it in to make sure it doesn't break any other use cases.

    Glad your solution is working well for you, and thanks again for the tip!
     
  4. alpapan

    alpapan

    Joined:
    Aug 10, 2019
    Posts:
    3
    Glad to be of assistance.

    Some of other discoveries I made:
    1) I generally thought it would be best to have a public variable (on tooltipmanager.instance) to host where the Tooltip container lives. This is updated every time it uses setparent (e.g. by a helper function that replaces setparent). I think that the current implementation uses Find which searches the entire hierarchy which is not very efficient..

    2) The never rotate canvas automatically grabs the first canvas that is not the tooltip. That's ok but it should be documented. I created a neverrotatecanvas and put it on top of my hieararchy to prevent protips messing around with the other canvases.

    3) I think that tooltip manager is expected to be at the top of the hierarchy. That is fine (even though cycling through root and storing the position by name might be cleaner) but it should also be documented. If someone doesn't place it at the top - or if anything else goes to the top before tooltip manager is woken up - then the tooltip container is stored in the wrong place. took me a while to figure that out.

    I love your plugin and it has been a pleasure working with it, sharing the source code was most helpful!
    alexie
     
    Duffer123 and zangad like this.
  5. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    @alpapan,

    Thank you for sharing your discoveries! Your points make a lot of sense, and I've added them to our roadmap for future updates.

    Over time, we've added features to ProTips from customer requests, and I agree that these haven't always been documented well, so we'll look at making another pass on the documentation to clarify how it works - or even better - change the gameobjects and naming conventions of containers so they are more intuitive.

    Thanks again, and please let us know if you have more suggestions.
     
    Duffer123 likes this.
  6. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Is ProTips compatible with Unity 2018.3.6 ?
     
  7. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    When I was updating the screenshots last week, I was using 2019. I haven't tried that particular version, but it worked fine with 2019.
     
    wood333 likes this.
  8. Labecki

    Labecki

    Joined:
    Apr 14, 2015
    Posts:
    17
    Hello, I find that whenever I destroy a GUI panel, if that panel has any Tooltip Triggers, I get the following error when the cursor hovers over any item with an attached ToolTip Trigger:

    MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.

    The error occurs at TooltipTrigger.cs line 116.

    Do you know what I might to do solve this problem?
     
    Last edited: Dec 11, 2019
  9. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @Labecki,

    Thanks for letting us know you're having an issue with ProTips. I took a look at it and tried to reproduce the issue, but was unable to get the MissingReferenceException you mentioned, so I may not be understanding the issue correctly.

    Here's a video of the steps I took to try to reproduce the issue. I ran the demo scene and deleted the Features GUI panel, which has Tooltip Triggers under it. Then I hovered over items in the remaining panel that had attached Tooltip Triggers.


    I also looked at the code, and for me, TooltipTrigger.cs line 116 is a blank line.

    2019-12-11.png

    I just started a new project and imported ProTips directly from the asset store (the latest version), so is it possible you modified the code for your project? If so, could you send me your version of the file, or what the code is doing at line 116, so I can get an idea of what might be going on there?

    Also, if you have steps to reproduce, that would be helpful. You can also send us a link to download your project (Dropbox, OneDrive, etc) and we can take a look at it from there.
     
  10. DavidLe360

    DavidLe360

    Joined:
    Dec 24, 2018
    Posts:
    127
    Hi, it's working for the newest Unity (2019.3.13.f1)?

    thx
     
    Last edited: May 19, 2020
    Duffer123 likes this.
  11. ooviixoo

    ooviixoo

    Joined:
    Dec 12, 2017
    Posts:
    11
    I've modified the code quite extensively for my purposes (i.e added TMPro, converted to Doozy Canvas, added a pinning system) and I've gotten the tooltips looking as I want, but I'm at a blocker... My intent is to do some real-time updating of elements within the tooltip and I need a pointer to the original object which triggered the tooltip to pop. Is there an easy way of discovering that bit? This is all 3D objects btw. I tried referencing tooltip.GameObject but that refers to the tooltip container, what I really need is linkage to the 3D object which spawned the tooltip. Any ideas?

    EDIT (Nevermind):

    I am an idiot... was so focused on Tooltip instead of TooltipTrigger:

    activeTooltipTrigger = activeTooltip.TooltipTrigger;
    Debug.Log("myGameObject " + activeTooltipTrigger.gameObject);

    ^^ This is all I needed.
     
    Last edited: Sep 23, 2020
  12. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    @ooviixoo,

    Ah, glad you figured it out. I was just taking a look at it and saw your comment. Thanks for letting me know, and posting the solution for others! :)
     
  13. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Hi Zang,

    F.Y.I. the links at the bottom of your post go to the "This Page Has Moved" notice page of the old asset store. Could use an update to connect them to your product pages in the "new" asset store. Oh, and I love your assets!
     
  14. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    @wood333 - Thanks for letting me know, I've updated my signature to the new asset store pages. :)
     
    wood333 likes this.
  15. ooviixoo

    ooviixoo

    Joined:
    Dec 12, 2017
    Posts:
    11
    Just want to do show off a quick review on some of the things I have achieved with Protips:



    If anyone wants particulars on my hackery, just ask =)
     
    zangad and Duffer123 like this.
  16. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    New update for ProTips!

    v1.7 (July 2021)

    New Features:
    • ProTips is now fully compatibile with TextMeshPro (but still works with the built-in UGUI Text UI).
    • TextMeshPro is now the default text UI system for the ProTips demos. The Unity UGUI Text UI demos are still available in a separate unitypackage under the Demos folder, and will continue to be supported.
    • Tooltips can now be used on TextMeshPro links (see "7. TexMeshPro Link Tooltips" demo scene).
    Minor Updates:
    • ProTips updated to Unity 2020.3.13.
     
  17. GerPronouncedGrr

    GerPronouncedGrr

    Joined:
    Mar 30, 2013
    Posts:
    25
    HI! This asset looks great and I am considering it for my upcoming project. I am wondering if it supports multiple tooltips being displayed at once, based on all layers under the mouse.

    As an example of what I am after, in the game Oxygen Not Included, each "tile" in the scene has multiple layers, such as gas layer, electrical layer, building layer, character layer, etc. And when you mouse over any area of the scene, the game will show you all tooltips that apply to all layers that exist under your mouse. So if I had a tile that contained oxygen, a bed, and a character standing in front of the bed, it would show the tooltips for all of those things simultaneously. I hope my question and example make sense!

    https://imgur.com/a/3mnOJUL Here is an example.
     
    Last edited: Jul 8, 2021
  18. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @GerPronouncedGrr,

    Your question makes sense, yes, and thanks for the image - that really illustrates what you're looking for. I think a tooltip like this is a great idea, I never thought of multiple tooltips at once. I think I can make ProTips do this, but with one tooltip that has multiple sections inside of it. ProTips can have multiple tooltips open at once, but they must be different tooltips. Now, you could theoretically just clone the same tooltip multiple times and save it as different prefabs, but that would be messy and not very elegant.

    I'm thinking of a single tooltip that has multiple sections inside of it that are turned on/off dynamically based on the data in the tooltip trigger (the object under the mouse pointer). The tooltip could be designed so it looks like each section is a different tooltip, like in your screenshot. They would all open/close at the same time, though, since the sections are under the same tooltip.

    I'll see what I can come up with, and post back with my findings. Thanks for the suggestion, I think it's a good one! :)
     
    Duffer123 likes this.
  19. GerPronouncedGrr

    GerPronouncedGrr

    Joined:
    Mar 30, 2013
    Posts:
    25
    Thanks very much! That's an encouraging response and I will check back here soon to see what you come up with.
     
  20. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    @GerPronouncedGrr,

    I was able to create a multi-panel dynamic section tooltip style in ProTips that (I think) achieves the effect you're looking for. I made a video to explain it (below), but here's also a screenshot:

    Screenshot:


    Video:


    We'll include this tooltip style in the next ProTips release, since others may find it useful, too. If you decide to purchase ProTips and want to get this tooltip style before our next release, please send us an email (modelsharkstudio@gmail.com) with your invoice number and we'll send you a pre-release version that includes it.

    Please let us know if you have any further questions, and thanks again for the suggestion, I think it's a neat tooltip idea!
     
  21. GerPronouncedGrr

    GerPronouncedGrr

    Joined:
    Mar 30, 2013
    Posts:
    25
    Thank you very much! This looks ideal for my purposes and I'll definitely be purchasing the asset.
     
  22. Abelius

    Abelius

    Joined:
    Nov 11, 2016
    Posts:
    37
    These three scenes...

    ...add themselves every single time I open Unity or build.

    Your plugin is the only one I have with this behavior. Some way to avoid that, other than deleting the demo folder?
     
  23. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @Abelius,

    You can safely delete the Startup.cs script here to prevent those scenes from getting added:



    I added that script recently to automatically add those scenes to the build, since our scenes are connected by buttons that transfer you from one to the next, and we didn't want anyone to get a runtime error if they didn't have a particular scene in their build settings.

    But in retrospect, this strategy is too heavy-handed, and we'll be removing this script for future versions of ProTips going forward.

    Thank you for letting us know, and please reach out if you have any further issues!
     
  24. Abelius

    Abelius

    Joined:
    Nov 11, 2016
    Posts:
    37
    Ah, great. Thank you for the detailed Sunday response. :D
     
  25. djdanlib

    djdanlib

    Joined:
    Jan 14, 2017
    Posts:
    15
    I'd like to pop up tooltips for 2D objects in a way that uses the stock ProTips package. Do you have any suggestions for making that work from the editor without writing code, or is that not in the cards right now?

    An example scenario is popping a tooltip when mousing over a 2D Sprite. It has a SpriteRenderer and a BoxCollider2D which derives from Collider2D which is incompatible with Collider, so Unity logs a MissingComponentException when it detects the mouseover. Adding a BoxCollider to the object would be problematic.

    I see code for grabbing coordinates from a Renderer in TooltipExtensions already, but I don't know how to (using only the Unity Editor) force it to use the correct positionBounds value to cause that behavior. It seems like that would do the job though.
     
  26. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @djdanlib,

    Thank you for your question and detailed example of the issue. I was able to setup a simple scene with a 2D Sprite with a BoxCollider2D, and recreated the "MissingComponentException" issue.

    This is something we haven't tried before, so the stock code doesn't support it out-of-the-box. However, I was able to make a code change that will allow ProTips to support this feature. Here's a screenshot of it working after the code changes:



    If you don't want to make any code changes yourself, you can send us your invoice number to modelsharkstudio@gmail.com, and we'll send you a package with the updated code and sample scene. However, if you want to give it a try, here are the step-by-step instructions to do it yourself:
    1. In your Unity project, open the file \Assets\ProTips\Scripts\Extensions\TooltipExtensions.cs in a text editor.
    2. At line 24, change your code so it looks like this, by copying and pasting the script code (below):



      Code (CSharp):
      1.                     Collider coll = trigger.GetComponent<Collider>();
      2.                     Collider2D coll2D = trigger.GetComponent<Collider2D>();
      3.                     if (coll != null)
      4.                     {
      5.                         center = coll.bounds.center;
      6.                         extents = coll.bounds.extents;
      7.                     }
      8.                     else if (coll2D != null)
      9.                     {
      10.                         center = coll2D.bounds.center;
      11.                         extents = coll2D.bounds.extents;
      12.                     }
    3. Save the file, and that's it! Go back to your example scenario and it should work now.
    If it doesn't work for you, or if you have issues, please let us know and we will try to help.
     
  27. djdanlib

    djdanlib

    Joined:
    Jan 14, 2017
    Posts:
    15
    That worked great! Thank you very much. This was fantastic support.

    I also shot myself in the foot by not setting the camera on the manager, but that was easy to fix by choosing the camera in the editor. If you don't set the camera, it throws another exception further down in the same function where it sets triggerCorners, because camera is null going into the function. If I could suggest a friendlier behavior, it would be to check whether camera is null before it hits that point and if so, return and put some kind of assertion message in the log to remind the dev to set it.
     
    zangad likes this.
  28. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    @djdanlib,

    That's great news, glad it worked for you!

    Thank you for the bug report and suggestion - I agree, it should never throw an exception because of a missing Camera in the scene. I have added this to our to-do list, and we'll get a fix for it in a future release.

    Thanks, and good luck with your project!
     
    Last edited: Jul 31, 2021
    djdanlib likes this.
  29. hfinn

    hfinn

    Joined:
    Oct 3, 2017
    Posts:
    5
    Hello.
    ProTips in Unity editor runs fine, but when I build it I get build errors as shown in the attached screenshot.
    I tested on 2020.3.12f1, 2020.3.14f1 and 2020.3.16f1
    I created a new project and built the demo, but I get a build error and I don't know how to fix it.
    Any help would be greatly appreciated

    upload_2021-8-19_22-37-14.png
     
  30. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @hfinn,

    Thank you for reaching out to us and bringing this issue to our attention. I've fixed the issues you mentioned with building ProTips and sent you a link to a new package to try out.

    There were two issues: one is that I had recently changed ProTips to use an AssemblyDefinition, which sounded good at the time, but now I found out that I need to also create assembly definitions for each Editor folder, which makes it too messy for the benefit (and causes Build errors if you don't create Editor Assmbly Defs), so I removed the AssemblyDefinition altogether. T

    The other issue was that I was calling EditorSceneManager in the demo button scripts, and EditorSceneManager only exists when you are in the Unity Editor. When you build, anything related to the Editor doesn't exist and throws an error. So now I've wrapped those statements with a precompiler directive, so if you are in the Editor, it uses EdtorSceneManager. If you are in Build Mode, it uses the SceneManager.

    Once I made these changes, it was building and running fine for me in both the Editor and the Build. Please let me know if the new package works for you, and if so I will include these fixes in the next ProTips update.
     
  31. hfinn

    hfinn

    Joined:
    Oct 3, 2017
    Posts:
    5


    The build works without any issues with the bug-fixed version you sent.
    (Verified in Unity 2020.3.14f1 and Unity 2020.3.16f1.)
    Thank you for your quick reply and improvement.
     
  32. sigenosys

    sigenosys

    Joined:
    Feb 14, 2021
    Posts:
    3
    @zangad

    Hello.
    Thank you for creating a great asset.

    I'm having a problem.
    I changed the tool tip style from a script at runtime, but ProTips doesn't recognize it and still treats it as the original style.

    <My Script(change the style)>
    Code (CSharp):
    1. TooltipStyle tooltipStyle = Resources.Load<TooltipStyle>("CleanSimpleFriend");
    2. TooltipTrigger.tooltipStyle = tooltipStyle;
    "CleanSimpleFriend" is a ToolTip prefab that I cloned and renamed from CleanSimple.
    (The contents are no different from CleanSimple.)

    I did this in order to display CleanSimple and CleanSimpleFriend at the same time.
    I thought the code needed to be changed, so I made the following changes

    <ToolTipManager.cs>
    Code (CSharp):
    1.  
    2. public IEnumerator Show(TooltipTrigger trigger)
    3. {
    4.  (...)
    5.             // If there is another tooltip open besides this one, close it.
    6.             foreach (KeyValuePair<TooltipStyle, Tooltip> tip in Tooltips)
    7.             {
    8.                 if (tip.Value.GameObject.activeInHierarchy && tip.Value ! = tooltip)
    9.                 {
    10.                     //Added condition
    11.                     if(tip.Key == tooltip.TooltipStyle)
    12.                            tip.Value.TooltipTrigger.ForceHideTooltip();
    13.                 }
    14.             }
    15. (...)
    16. }
    Even if we do this, ProTips won't recognize the modified "CleanSimpleFriend", so it will assume the same style as "CleanSimple" and won't be able to display the second tip, CleanSimpleFriend.

    Is there any way to solve this problem?

    ProTips Ver1.7
    Unity 2020.3.5f1

    Thank you in advance.
     
  33. sigenosys

    sigenosys

    Joined:
    Feb 14, 2021
    Posts:
    3
    After posting the question above, I found out that in some cases the script to change the style works correctly.

    Therefore, there may be a problem with my game program.
    I will investigate a bit more and report back if I find out anything.

    Note that I have confirmed that if I set "CleanSimpleFriend" as ToolTipStyle in the editor mode beforehand, rather than from a script, the two tips are displayed simultaneously without any problem.
     

    Attached Files:

  34. sigenosys

    sigenosys

    Joined:
    Feb 14, 2021
    Posts:
    3
    I was able to solve the problem.
    Initialize() is not executed, so the contents of the Tooltip are not updated, which seems to be the cause.
    I added the following function to TooltipTrigger.cs.

    Code (CSharp):
    1. public void UpdateTooltip()
    2. {
    3.         Tooltip =  TooltipManager.Instance.Tooltips[tooltipStyle];
    4. }

    The following function was added to TooltipTrigger.cs, and this function is now called in the Tooltip Style update process.

    Code (CSharp):
    1. TooltipStyle tooltipStyle = Resources.Load<TooltipStyle>("CleanSimpleFriend");
    2. TooltipTrigger.tooltipStyle = tooltipStyle;
    3. TooltipTrigger.UpdateTooltip();
    Now, both tips can be called at the same time.

    If you have any problems with this procedure, please let me know.
     
    Last edited: Aug 21, 2021
  35. Abelius

    Abelius

    Joined:
    Nov 11, 2016
    Posts:
    37
    Hi there,

    For some unknown reason, I don't see TextMeshPro components anywhere in the plugin style prefabs. And I don't see that the demo scenes supposedly associated to them anywhere in the demo folder.

    This is the built-in CleanSimple style, and a regular Text component shows up:



    I've uninstalled the plugin completely and reinstalled it from the Asset Store 1.7 version, to no avail. It's still the same.

    So, I went and tried to substitute the Text component for a TMP Text, anyway, but it doesn't work:



    At this point I'm not sure the version on the Asset Store is actually 1.7... (?)

    Or am I doing something wrong?
     
  36. he1mspiel

    he1mspiel

    Joined:
    Jul 19, 2017
    Posts:
    1
    Just downloaded it from the Asset Store and its Version 1.6
     
  37. Abelius

    Abelius

    Joined:
    Nov 11, 2016
    Posts:
    37
    That seems to be the case.

    So... Can we have an official reply from the author, please?
     
  38. Rokatanskii

    Rokatanskii

    Joined:
    Apr 21, 2021
    Posts:
    1
    I created a button following manual and it works, but only if it's starting scene. When I press play from any other scene and then accessing scene and hover mouse over button with tooltip I have an error:

    MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    ModelShark.TooltipTrigger.OnPointerEnter (UnityEngine.EventSystems.PointerEventData eventData) (at Assets/ProTips/Scripts/Behaviors/TooltipTrigger.cs:115)
    UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerEnterHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:22)
    UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:262)
    UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)
     
    Last edited: Sep 27, 2021
  39. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @sigenosys,

    Sorry, for some reason we haven't been getting notifications when people post on our forum, even though we are subscribed to the forum thread. So I missed your initial question.

    Glad you got it working, though. I am looking at your solution to see if I need to add anything to ProTips, and where. I'm not sure I fully understand why it was working with some tooltips and not others, but I will try to reproduce the issue on my end and see if I find a problem. Thank you for posting your solution!
     
  40. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @Abelius & @he1mspiel,

    Sorry, we haven't been getting notifications for this forum for a few weeks, so I missed your question. I suspect the issue is you are using a version of Unity older than 2020.3.13f1 for your project. If so, the Unity Package Manager will download and install the previous version (1.6), which does not use TextMeshPro as the default.

    I could swear there used to be a way in Unity to download a specific version of an asset, but I just tried it out with Unity 2019, and I couldn't figure out how to get the 1.7 version of ProTips to install. Only when I updated to 2020.3.13f1 or higher was I able to get the 1.7 version of ProTips.

    This has caused some confusion for customers since our 1.7 update, so we added this note (in bold) to our store page:

    New in 1.7!
    (NOTE: You must use Unity 2020.3.13f1 or higher to see these new features)
    * Full compatibility with TextMeshPro (but still works with the built-in UGUI Text UI)!
    * Tooltips can be used on TextMeshPro links (included demo scene illustrates how to do it)!

    So, you can either update your Unity project to 2020.3.13f1 and then re-import ProTips, or if you can't or don't want to update your Unity project, we can send you the 1.7 version of ProTips directly, just email us at modelsharkstudio@gmail.com with your proof of purchase (invoice # or similar) and we'll email you back with a link to a 1.7 unitypackage you can install directly.

    Apologies for the extra hoops to jump through, but unfortunately I don't know of another way you can download a specific version of an asset anymore. Ideally when a customer buys an asset, they should be able to download any version of it they want, whether it's a newer or older version that may target a different Unity build. But it seems like the version of an asset is now tied to the version of Unity you're using. If anyone knows a way around this, please let me know.

    (EDIT)
    We just thought of another way you can get the 1.7 version of ProTips if you don't want to update your project and without having to wait on us to send you a unitypackage...

    1) Create a new throwaway project using Unity version 2020.3.13f1 or higher.
    2) Download ProTips from that project.
    3) Go to your C:\Users\[YOURNAME]\AppData\Roaming\Unity\Asset Store-5.x\ModelShark Studio\ScriptingGUI\ folder and get the ProTips unitypackage there. It should be the 1.7 version.
    4) Install that unitypackage into your existing (older) project. Now you should have the 1.7 version of ProTips that has TextMeshPro as the default.

    Still not a great process, but hopefully that helps.
     
    Last edited: Sep 27, 2021
  41. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @Rokatanskii,

    I just tried to reproduce this issue by creating a new scene and putting a single button in it that loads our "2. ProTips Demo" scene. I then started the new scene, clicked the button, and everything worked fine when the demo scene loaded and I hovered over a tooltip trigger.

    That error is indicating the tooltip doesn't exist in the scene anymore, but a script is trying to reference it. I would like to take a look at your project to see what's causing this and provide a fix. Can you upload your scene (Dropbox, GoogleDrive, OneDrive, etc) and send us a link to it (modelsharkstudio@gmail.com)?
     
  42. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi all,

    We've updated ProTips to version 1.7.1. It's a small update to address an error when you create a Build of your project. The full details are discussed in this post.

    Here are the release notes:
    * Fixed error happening on Build where it was looking for the EditorSceneManager which does not exist outside of the editor.
    * Removed the ProTips assembly definition to make it easier for customers to integrate into their existing projects.

    Note: You will need to update your Unity editor to 2020.3.14f1 or higher to install the 1.7.1 version of ProTips and get these changes.
     
  43. Abelius

    Abelius

    Joined:
    Nov 11, 2016
    Posts:
    37
    Could you add support for TMP to 1.6, as a final update to that version, please?

    Updating the whole project to 2020 is way too risky just for getting TMP support.
     
  44. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Thanks for your patience, I think we finally have a solution to this problem. We submitted a 1.7.2 version of ProTips for Unity 2019.4.30f1 (LTS) that has the TextMeshPro features in it. It is exactly the same version that works with Unity 2020 and 2021.

    So in Unity 2019.4.30f1, you can go to the Package Manager and try to update to 1.7.2. That might work for you, and if so, you are good-to-go. But if it doesn't work, and it keeps trying to download the 1.6 version of ProTips (you can tell because the scenes won't be numbered), that's actually a problem with the Package Manager (more info here). But there's a workaround:

    Go to your %AppData% folder where your Unity asset cache is, and delete the ModelShark Studio folder (C:\Users\[YOURNAME]\AppData\Roaming\Unity\Asset Store-5.x\ModelShark Studio). That will remove all of the cached versions of ProTips you may have downloaded. Then, restart the Unity editor (refreshing wasn't enough for me) and open the Package Manager again, and you should be able to download and import the 1.7.2 version of ProTips into your 2019 project. Here's what it should look like:



    If you have any issues, please let us know!
     
    Last edited: Oct 1, 2021
  45. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Oh, and just a side-note in case anyone is using Unity 2018, I tried backporting the latest version of ProTips to Unity 2018, but it didn't work. There were far too many changes over the years with both ProTips code and TextMeshPro. So you'll at least need to update to Unity 2019 LTS in order to get the TextMeshPro integration and other features.
     
  46. lemapp

    lemapp

    Joined:
    Mar 30, 2020
    Posts:
    34
    Two issues:
    - Attempts in install 1.7.2 generate errors about Collaborate. I'm using the Unity GitHub resource for version control. Perhaps it makes use of Collaborate in the background.

    - I'm wanting to 'Localize' my project for different languages around the world. I've discovered that I don't know how to update the various ToolTips to the correct language. Do you have a suggestion?

    Thanks
     
  47. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @lemapp,

    Collaborate Errors:
    We're not seeing any errors when we import ProTips into a new project, so we can't reproduce the specific issue, but I have some questions:
    • What errors are you getting specifically?
    • Do you only get the errors when you're using Collaborate, only on initial ProTips import, or does it just spam all the time?
    • What version of Unity are you using?
    • Are you importing ProTips into an existing or new project?
    • Do you get these Collaborate errors in any other projects, or only ones that have ProTips in them?
    • Do the errors prevent you from building/running the scene, or from syncing your changes to source control?
    We get Collaborate errors all the time, such as null reference exceptions, the inability to refresh the progress update bar, etc. But I think these are just issues with Collaborate, because we get these errors in every project we use Collaborate with. And they're very inconsistent. The only way I've found to remove these errors is to remove the Version Control package from Package Manager. But then you probably can't use version control through Unity. I checked to see if we're adding the Version Control package with our asset install, but it's actually added to all new projects, so as far as I can tell there's nothing we added that would cause these Collaborate errors to start. But you're not the only one to report these errors, so if there is something I can track down to fix it, that'd be great. Any details you can provide to help me reproduce this issue would be greatly appreciated.

    Localization:
    ProTips doesn't have any built-in localization support, but I think it's a great idea. I'm adding it to our to-do list for later review. However, currently one way you could achieve this is through code using the TooltipTrigger SetText() method to set the text through code. I put together a simple localization script you can try out to see what I'm talking about. Just drop this script on any gameobject that has a TooltipTrigger:

    Code (CSharp):
    1. using System.Collections.Generic;
    2. using UnityEngine;
    3.  
    4. namespace ModelShark
    5. {
    6.     public class TooltipLocalization : MonoBehaviour
    7.     {
    8.         public string selectedLanguage = "en";
    9.         public string phraseKey = "hat";
    10.  
    11.         // Setup your localization dictionaries
    12.         private Dictionary<string, string> englishText = new Dictionary<string, string>();
    13.         private Dictionary<string, string> spanishText = new Dictionary<string, string>();
    14.  
    15.         private void Awake()
    16.         {
    17.             AddEntriesToLanguageDictionary();
    18.         }
    19.  
    20.         private void Start()
    21.         {
    22.             // Get the TooltipTrigger component on the current gameobject.
    23.             TooltipTrigger tooltipTrigger = gameObject.GetComponent<TooltipTrigger>();
    24.  
    25.             // Set the tooltip text, depending on the language chosen.
    26.             switch (selectedLanguage)
    27.             {
    28.                 case "en":
    29.                     tooltipTrigger.SetText("BodyText", englishText[phraseKey]);
    30.                     break;
    31.                 case "es":
    32.                     tooltipTrigger.SetText("BodyText", spanishText[phraseKey]);
    33.                     break;
    34.             }
    35.         }
    36.  
    37.         private void AddEntriesToLanguageDictionary()
    38.         {
    39.             // Add phrases for each dictionary here
    40.             englishText.Add("greeting", "Hello!");
    41.             englishText.Add("hat", "I like your hat.");
    42.  
    43.             spanishText.Add("greeting", "Hola!");
    44.             spanishText.Add("hat", "Me gusta tu sombrero.");
    45.         }
    46.     }
    47. }
    48.  
    Then you select your language ("en" or "es") on the component, and select a phrase from your localization dictionaries (here, I selected the "hat" phrase and Spanish language):



    And here are the results when you hover over the Tooltip Trigger (a button in this case):


    You would probably want to put your language dictionary in a separate class, maybe a LanguageManager or something like that. That way, you could set your language preference once and only call into the LanguageManager to get phrases by their keys. Hopefully, this script gives you some ideas on how to get started. :)
     
    Last edited: Oct 5, 2021
  48. mathieso

    mathieso

    Joined:
    May 17, 2020
    Posts:
    9
    Hi,

    Another NullReferenceException problem. I have two scenes, a loader and a main one. Both have TooltipManagers. The first scene works well. The only issue I had was that tooltips would stay visible. So, say a checkbox has a TooltipTrigger. While a tooltip is showing, the user hits Escape, and that does SetActive(false) on a parent GO of the checkbox. The tooltip would still be visible. I fixed that by calling TooltipManager.Instance.HideAll() when hiding the parent. That worked fine.

    The second scene causes all sorts of issues though. The are two NullReferenceExceptions. The first:

    NullReferenceException: Object reference not set to an instance of an object
    ModelShark.TooltipTrigger.OnSelect (UnityEngine.EventSystems.BaseEventData eventData) (at Assets/ProTips/Scripts/Behaviors/TooltipTrigger.cs:176)

    The line is:

    if (Tooltip.GameObject.activeInHierarchy && Tooltip.TooltipTrigger == this) return;

    Tooltip was null.

    The second problem:

    MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    ModelShark.TooltipTrigger.Initialize () (at Assets/ProTips/Scripts/Behaviors/TooltipTrigger.cs:66)
    ModelShark.TooltipTrigger.Start () (at Assets/ProTips/Scripts/Behaviors/TooltipTrigger.cs:51)

    The code is on that line is:

    ttStyle.transform.SetParent(TooltipManager.Instance.TooltipContainer.transform, false);

    TooltipManager.Instance.TooltipContainer is empty.

    I noticed that I had 30 copies of the formatting object in the hierarchy, if that matters.

    Any thoughts?

    Kieran
     
    zangad likes this.
  49. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    Hi @mathieso,

    Thanks for reporting these errors. I've hardened the code in the areas you mentioned. The changes will go live in the next ProTips update. Here's what I changed, if you or anyone else is getting Null Reference Exceptions and wants to go ahead and change it on your copy of ProTips.

    For the NRE at TooltipTrigger.cs line 176, I added this:
    Code (CSharp):
    1. // Ignore if Tooltip is null, or Tooltip.GameObject is null, or Tooltip.TooltipTrigger is null.
    2. if (Tooltip == null || Tooltip.GameObject == null || Tooltip.TooltipTrigger == null) return;
    For the NRE at TooltipTrigger.cs line 66, I added this:
    Code (CSharp):
    1. if (TooltipManager.Instance.TooltipContainer != null)
    2.     ttStyle.transform.SetParent(TooltipManager.Instance.TooltipContainer.transform, false);
    So with those changes, you won't get the Null Reference Exceptions anymore, but the behavior might still not be as expected. Hardening the code doesn't fix the underlying issues that caused the NREs. So if you're still having issues after these code changes, please let us know what behavior you're seeing, or how to reproduce the issue, or better yet send us a link to download your full project (just zip it up at the project folder level, upload to DropBox/OneDrive/etc and send the link to modelsharkstudio@gmail.com). I'd like to take a look at it and see how you're using ProTips and how that differs from how we setup our demo scenes. Thanks!
     
  50. lemapp

    lemapp

    Joined:
    Mar 30, 2020
    Posts:
    34
    Un-installing Version Control still produces the same errors. After I select, ProTips from Package Manager, the cursor spins. Then it asks to install/upgrade. Clicking this causes the errors to appear. Then the next pop-up screen is for Import. So the errors are appearing in the install process just before the final step, Install.

    GUID [94759c1d3bad4ea428b6345ff274c753] for asset 'Assets/ProTips/Demos (safe to delete)/6. World Space Canvas Overlay.unity' conflicts with:
    'Assets/ProTips/Demos (safe to delete)/6. WorldSpaceCanvasOverlayTooltips.unity' (current owner)
    Assigning a new guid.
    --------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/CollabToolbarWindow.cs(14,23): error CS0246: The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?)
    ---------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/Presenters/CollabHistoryPresenter.cs(21,9): error CS0246: The type or namespace name 'BuildAccess' could not be found (are you missing a using directive or an assembly reference?)
    ----------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/CollabToolbarWindow.cs(26,42): error CS0246: The type or namespace name 'WebViewEditorStaticWindow' could not be found (are you missing a using directive or an assembly reference?)
    ----------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/CollabToolbarWindow.cs(19,39): error CS0246: The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?)
    -------------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/CollabToolbarWindow.cs(12,9): error CS0246: The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?)
    ---------------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/CollabToolbarWindow.cs(28,27): error CS0246: The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?)
    --------------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/CollabToolbarWindow.cs(28,35): error CS0115: 'CollabToolbarWindow.webView': no suitable method found to override
    ------------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/CollabToolbarWindow.cs(109,30): error CS0115: 'CollabToolbarWindow.OnEnable()': no suitable method found to override
    -----------
    Library/PackageCache/com.unity.collab-proxy@1.8.0/Editor/Collaborate/Collab/CollabToolbarWindow.cs(26,69): error CS0535: 'CollabToolbarWindow' does not implement interface member 'IHasCustomMenu.AddItemsToMenu(GenericMenu)'

    There are a total of 1 Alerts and 9 errors. At this point, I'm unable to proceed further. I revert back to a previous version that I'm doing manually.
     
    zangad likes this.