15
2012
How to make GUITexture to flash white
(Been busy doing a small 3D simulator for iPad3..)
Customer wanted a thunder sound on the main menu (when entering it),
I also added a brigth flash effect for the gui textures (logo, buttons, background).
Flash also needs to happen at a given time (to match the sound).
Version#1
// variables
– take reference to each GUITexture objects, get their textures
– variable for flash texture (could be just white blurred box..)
Awake()
– Disable gui textures (you could disable them in inspector, but then you cannot see them in editor..)
Start()
– invoke(“FlashGUI(),1.5);
FlashGUI()
– Change GUITexture color to Color.white, that makes it brighter
– If changing color doesnt do it, change gui texture to white texture
– invoke(“ShowGUI(),0.2); // we show the white textures for 0.2sec, then go to switch real gui textures
ShowGUI()
– Change GUITexture color to Color(0.5,0.5,0.5,1), that makes it normal color
– If you didnt change color, change gui texture to correct gui texture
//notes
– It might look better with a fast color fade, from bright to normal(?)
– You could also do this in the Update() loop: check in which part of the sound is playing (audiosource.time)
Related Posts
Leave a comment
Recent posts
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
- GeoTiff Importer & Terrain Generator for Unity
- Create Baked DropShadow for UI images
- .JP2 Ortho Image Converter to PNG/JPG/TIFF
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
- Detect SRP (URP or HDRP) with Assembly Definition Version Defines
- [LudumDare57] Theme: Depths
- MotionVector Effect: Object “disappears” when paused
Recent Comments
- on [Asset Store] PolygonCollider2D Optimizer
- on Trajectory Test Scene 2.0
- on Vector3 maths for dummies!
- on UnityHub 3.6.0: Remove Version Control & Cloud Dashboard columns
- on Using RenderDoc with Unity (graphics debugger)
- on UI Scroll View automatic Content height
- on [Asset Store] Point Cloud Viewer & Tools
- on [Asset Store] Point Cloud Viewer & Tools
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by











