{"id":898,"date":"2012-05-15T23:35:20","date_gmt":"2012-05-15T20:35:20","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=898"},"modified":"2012-05-15T23:35:20","modified_gmt":"2012-05-15T20:35:20","slug":"how-to-make-guitexture-to-flash-white","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2012\/05\/15\/how-to-make-guitexture-to-flash-white\/","title":{"rendered":"How to make GUITexture to flash white"},"content":{"rendered":"<p>(Been busy doing a small 3D simulator for iPad3..)<\/p>\n<p>Customer wanted a thunder sound on the main menu (when entering it),<br \/>\nI also added a brigth flash effect for the gui textures (logo, buttons, background).<br \/>\nFlash also needs to happen at a given time (to match the sound).<\/p>\n<p><strong>Version#1<\/strong><\/p>\n<p><strong>\/\/ variables<\/strong><br \/>\n&#8211; take reference to each GUITexture objects, get their textures<br \/>\n&#8211; variable for flash texture (could be just white blurred box..)<\/p>\n<p><strong>Awake()<\/strong><br \/>\n&#8211; Disable gui textures (you could disable them in inspector, but then you cannot see them in editor..)<\/p>\n<p><strong>Start()<\/strong><br \/>\n&#8211; invoke(&#8220;FlashGUI(),1.5);<\/p>\n<p><strong>FlashGUI()<\/strong><br \/>\n&#8211; Change GUITexture color to Color.white, that makes it brighter<br \/>\n&#8211; If changing color doesnt do it, change gui texture to white texture<br \/>\n&#8211; invoke(&#8220;ShowGUI(),0.2); \/\/ we show the white textures for 0.2sec, then go to switch real gui textures<\/p>\n<p><strong>ShowGUI()<\/strong><br \/>\n&#8211; Change GUITexture color to Color(0.5,0.5,0.5,1), that makes it normal color<br \/>\n&#8211; If you didnt change color, change gui texture to correct gui texture<\/p>\n<p><strong>\/\/notes<\/strong><br \/>\n&#8211; It might look better with a fast color fade, from bright to normal(?)<br \/>\n&#8211; You could also do this in the Update() loop: check in which part of the sound is playing (<a title=\"http:\/\/unity3d.com\/support\/documentation\/ScriptReference\/AudioSource-time.html\" href=\"http:\/\/unity3d.com\/support\/documentation\/ScriptReference\/AudioSource-time.html\" target=\"_blank\">audiosource.time<\/a>)<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[148,3],"tags":[243,50,242,761,239,240,241],"class_list":["post-898","post","type-post","status-publish","format-standard","hentry","category-help","category-unity3d","tag-delay","tag-effect","tag-event","tag-flash","tag-guitexture","tag-sound","tag-time"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-eu","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=898"}],"version-history":[{"count":1,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/898\/revisions"}],"predecessor-version":[{"id":899,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/898\/revisions\/899"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}