diff options
author | chai <chaifix@163.com> | 2021-04-21 21:52:56 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-04-21 21:52:56 +0800 |
commit | 6d0c9a214dc0fda264e8588fa02aaa19b0b2cc5f (patch) | |
tree | 6a853a0b0cfb5818c864c3794cb58075876c07b0 /Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs |
+init
Diffstat (limited to 'Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs')
-rw-r--r-- | Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs b/Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs new file mode 100644 index 0000000..44971b2 --- /dev/null +++ b/Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs @@ -0,0 +1,39 @@ +/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com + +using UnityEngine; +using System.Collections; + +public class SwitchCameraDemo : MonoBehaviour { + + public ProFlareBatch flareBatch; + + public Camera camera1; + public Camera camera2; + + public bool switchNow; + + bool ping; + void Start () { + camera2.enabled = false; + } + + void Update () { + if(switchNow){ + + switchNow = false; + + if(!ping){ + ping = true; + flareBatch.SwitchCamera(camera2); + camera2.enabled = true; + camera1.enabled = false; + }else{ + ping = false; + flareBatch.SwitchCamera(camera1); + camera1.enabled = true; + camera2.enabled = false; + + } + } + } +} |