Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[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:
    225
    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:
    225
    @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:
    670
    Is ProTips compatible with Unity 2018.3.6 ?
     
  7. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    180
    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:
    16
    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:
    225
    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:
    83
    Hi, it's working for the newest Unity (2019.3.13.f1)?

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