登录 注册
当前位置:主页 > 资源下载 > 50 > Unity3D 中实现画面扭曲切换的脚本

Unity3D 中实现画面扭曲切换的脚本

  • 更新:2024-09-11 12:02:56
  • 大小:15KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Java - 后端
  • 格式:TXT

资源介绍

Unity3D 画面扭曲切换效果脚本 DreamWipe.js 1. var camera1 : Camera; 2.var camera2 : Camera; 3.var fadeTime = 4.0; 4.var waveScale = .07; // Higher numbers make the effect more exaggerated. Can be negative, .5/-.5 is the max 5.var waveFrequency = 25.0; // Higher numbers make more waves in the effect 6.private var inProgress = false; 7.private var swap = false; 8. 9.function Start () { 10. ScreenWipe.use.InitializeDreamWipe(); 11.} 12.function Update () { 13. if (Input.GetKeyDown("space")) { 14. DoFade(); 15. } 16.} 17.function DoFade () { 18. if (inProgress) return; 19. inProgress = true; 20. 21. swap = !swap; 22. yield ScreenWipe.use.DreamWipe (swap? camera1 : camera2, swap? camera2 : camera1, fadeTime, waveScale, waveFrequency); 23. 24. inProgress = false; 25.}