Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GUItexture button help

Discussion in 'Scripting' started by Nabil_fx, Apr 26, 2015.

  1. Nabil_fx

    Nabil_fx

    Joined:
    Nov 9, 2013
    Posts:
    124
    How can i keep just the GUI.texture os press, i dont want the effect of the GUIbutton. It is possible?


    Code (CSharp):
    1. usingSystem.IO;
    2.  
    3. publicclassDemoScript : MonoBehaviour {
    4.  
    5. publicTexture2Dtexture;
    6. boolsavedScreenshot = false;
    7. boolsavedExistingImage = false;
    8. boolhideGUI = false;
    9. publicTexturebuttonTexture;
    10.  
    11. voidStart ()
    12. {
    13. //callbacks
    14. ScreenshotManager.ScreenshotFinishedSaving += ScreenshotSaved;
    15. ScreenshotManager.ImageFinishedSaving += ImageAssetSaved;
    16. }
    17.  
    18. voidOnGUI ()
    19. {
    20.  
    21. if(!hideGUI)
    22. {
    23.  
    24. if (GUI.Button(newRect(30, 70, 50, 30), newGUIContent(buttonTexture)))
    25.  
    26. {