Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Any way to pass a tooltip between scripts?

Discussion in 'Immediate Mode GUI (IMGUI)' started by bigkahuna, Nov 21, 2007.

  1. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I've created a separate script to display a banner that always stays on top of my other GUI elements. How can I display a tool tip in my "banner" script when the mouse passes my "other window" script?
     
  2. kattkieru

    kattkieru

    Joined:
    Jan 2, 2006
    Posts:
    130
    You could give the "other window" script a pointer to the "banner" game object. Then, when the mouse moves over the "other window," it'd get the banner object's "banner" class and either call a public method or set a property.

    This is how I've been doing stuff in my own tests. It's pretty great -- I just drop one object into another's property list and go. The down side is that there's some jitter with GUI movement that I haven't sorted out -- in my space shooter, the ship rotates fluidly but its targeting reticles shake.