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
- Adding Real World Location to Ice Fishing Prototype
- [web tool] Image Channel Inspector : AlphaScope
- Editor Tool: Smart Recompile (don’t recompile if edit comments)
- Editor Tool: Scene Size Analyzer
- LudumDare 60: Old Tech
- uBasic Scripting Language for Unity
- GreaseMonkey+Editor Plugin: 1-Click Copy script from ChatGPT (Web) to Unity Editor (as script)
- Editor Tool: Property Watcher
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by











