Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

How can i know when a gui element is no longer rendered by camera

Discussion in 'UGUI & TextMesh Pro' started by Ahmadhp, Dec 19, 2014.

  1. Ahmadhp

    Ahmadhp

    Joined:
    May 31, 2013
    Posts:
    33
    Hi,

    I wanted to know when a gui element ( like button ) is no longer rendered by camera. I know there is a monobehaviour event "OnBecameInvisible" that did this, but it is not working with new gui elements ( with canvas renderer ).
    So , any ideas ?
     
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    you'll have to compare the element to the camera's frustum. We currently don't do that sort of processing.