noocrypte.net http://noozone.free.fr/noocrypte/ |
|
Unity3d Click receiver motion Eric Wenger http://noozone.free.fr/noocrypte/viewtopic.php?f=47&t=920 |
Page 1 sur 1 |
Auteur: | yann.minh [ Ven Avr 22, 2011 4:17 am ] |
Sujet du message: | Unity3d Click receiver motion Eric Wenger |
Script Ecrit par Eric Wenger pour le noomuseum de yann Minh sur Unity en Avril 2010 Code: private var moving=0; //voice sphere
function Update () { if(moving){ var t=Time.time; var sn=Mathf.Sin(t); renderer.material.color.r=sn*sn; renderer.material.mainTextureOffset = Vector2 (0, - t*0.4); transform.Rotate(0, -0.5, 0); } if(audio.isPlaying){ var dfade=1/(0.1*25.0); if(audio.volume<0.95){ audio.volume += dfade; } }else{ moving=0; } } function OnMouseDown () { audio.loop = false; audio.volume = 0.01; if(audio.isPlaying){ audio.Pause(); }else{ audio.Play(); moving=1; } } |
Page 1 sur 1 | Heures au format UTC [ Heure d’été ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |