summaryrefslogtreecommitdiff
path: root/Assets/ProFlares/DemoScripts
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-04-21 21:52:56 +0800
committerchai <chaifix@163.com>2021-04-21 21:52:56 +0800
commit6d0c9a214dc0fda264e8588fa02aaa19b0b2cc5f (patch)
tree6a853a0b0cfb5818c864c3794cb58075876c07b0 /Assets/ProFlares/DemoScripts
+init
Diffstat (limited to 'Assets/ProFlares/DemoScripts')
-rw-r--r--Assets/ProFlares/DemoScripts/AddForceToTarget.cs27
-rw-r--r--Assets/ProFlares/DemoScripts/AddForceToTarget.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/CopyRotationValue.cs26
-rw-r--r--Assets/ProFlares/DemoScripts/CopyRotationValue.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/DemoControls.cs253
-rw-r--r--Assets/ProFlares/DemoScripts/DemoControls.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/MultiCameraDemo.cs101
-rw-r--r--Assets/ProFlares/DemoScripts/MultiCameraDemo.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/PresetViewer.cs99
-rw-r--r--Assets/ProFlares/DemoScripts/PresetViewer.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/RandomPos.cs34
-rw-r--r--Assets/ProFlares/DemoScripts/RandomPos.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/RotateTransform.cs21
-rw-r--r--Assets/ProFlares/DemoScripts/RotateTransform.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/SpinInput.cs129
-rw-r--r--Assets/ProFlares/DemoScripts/SpinInput.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/SplitScreenDemo.cs53
-rw-r--r--Assets/ProFlares/DemoScripts/SplitScreenDemo.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs39
-rw-r--r--Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/TranslateCurve.cs26
-rw-r--r--Assets/ProFlares/DemoScripts/TranslateCurve.cs.meta11
-rw-r--r--Assets/ProFlares/DemoScripts/Zoom.cs47
-rw-r--r--Assets/ProFlares/DemoScripts/Zoom.cs.meta11
24 files changed, 987 insertions, 0 deletions
diff --git a/Assets/ProFlares/DemoScripts/AddForceToTarget.cs b/Assets/ProFlares/DemoScripts/AddForceToTarget.cs
new file mode 100644
index 0000000..3179773
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/AddForceToTarget.cs
@@ -0,0 +1,27 @@
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+using UnityEngine;
+using System.Collections;
+namespace ProFlares {
+public class AddForceToTarget : MonoBehaviour {
+ public Transform target;
+ public float force;
+
+ public ForceMode mode;
+
+ void FixedUpdate () {
+
+
+ float dist = (Vector3.Distance(transform.position,target.position)*0.01f);
+
+
+ Vector3 dir = target.position-transform.position;
+#if UNITY_5_0
+ GetComponent<Rigidbody>().AddForce(dir*(force*dist),mode);
+#else
+ GetComponent<Rigidbody>().AddForce(dir*(force*dist),mode);
+#endif
+
+ }
+}
+} \ No newline at end of file
diff --git a/Assets/ProFlares/DemoScripts/AddForceToTarget.cs.meta b/Assets/ProFlares/DemoScripts/AddForceToTarget.cs.meta
new file mode 100644
index 0000000..69fcd6e
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/AddForceToTarget.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 32d1adcc0c51347b5920c96fb9e60544
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/CopyRotationValue.cs b/Assets/ProFlares/DemoScripts/CopyRotationValue.cs
new file mode 100644
index 0000000..f42b896
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/CopyRotationValue.cs
@@ -0,0 +1,26 @@
+//// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+
+/// CopyRotationValue.cs
+/// Copy the targets transforms rotational value.
+
+using UnityEngine;
+using System.Collections;
+
+namespace ProFlares {
+ public class CopyRotationValue : MonoBehaviour {
+ public Transform target;
+
+ Transform thisTrans;
+ void Start () {
+ thisTrans = transform;
+ if(target == null)
+ this.enabled = false;
+ }
+
+ void LateUpdate () {
+
+ thisTrans.localRotation = target.rotation;
+ }
+ }
+}
diff --git a/Assets/ProFlares/DemoScripts/CopyRotationValue.cs.meta b/Assets/ProFlares/DemoScripts/CopyRotationValue.cs.meta
new file mode 100644
index 0000000..d2cc490
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/CopyRotationValue.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: caeefc16a0ffc48dd8f63c1c92e16f99
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/DemoControls.cs b/Assets/ProFlares/DemoScripts/DemoControls.cs
new file mode 100644
index 0000000..7d41771
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/DemoControls.cs
@@ -0,0 +1,253 @@
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+
+using UnityEngine;
+using System.Collections;
+
+public class DemoControls : MonoBehaviour {
+
+ public GameObject Setup1;
+
+ public GameObject Setup1Extra;
+ public Color Setup1Ambient;
+
+ public GameObject Setup2;
+
+ public GameObject Setup2Extra;
+ public Color Setup2Ambient;
+ public GameObject Setup3;
+
+ public GameObject Setup3Extra;
+ public Color Setup3Ambient;
+ public bool Toggle;
+
+
+
+ // Use this for initialization
+ void Start () {
+ Swap(1);
+ }
+
+
+ void Swap(int number){
+ switch(number){
+
+ case(1):{
+ Setup1.SetActive(true);
+ Setup2.SetActive(false);
+ if(Setup3)Setup3.SetActive(false);
+
+ if(Setup1Extra) Setup1Extra.SetActive(true);
+ if(Setup2Extra) Setup2Extra.SetActive(false);
+ if(Setup3Extra) Setup3Extra.SetActive(false);
+
+ RenderSettings.ambientLight = Setup1Ambient;
+ }break;
+
+ case(2):{
+ Setup1.SetActive(false);
+ Setup2.SetActive(true);
+ if(Setup3)Setup3.SetActive(false);
+
+ if(Setup1Extra) Setup1Extra.SetActive(false);
+ if(Setup2Extra) Setup2Extra.SetActive(true);
+ if(Setup3Extra) Setup3Extra.SetActive(false);
+
+ RenderSettings.ambientLight = Setup2Ambient;
+
+ }break;
+
+ case(3):{
+ Setup1.SetActive(false);
+ Setup2.SetActive(false);
+ if(Setup3)Setup3.SetActive(true);
+
+ if(Setup1Extra) Setup1Extra.SetActive(false);
+ if(Setup2Extra) Setup2Extra.SetActive(false);
+ if(Setup3Extra) Setup3Extra.SetActive(true);
+
+ RenderSettings.ambientLight = Setup3Ambient;
+
+ }break;
+ }
+ }
+
+ public bool hideGUI;
+
+ public ProFlareBatch batchLeft;
+ public ProFlareBatch batchRight;
+
+ void Update(){
+
+ if(Input.GetKeyUp("1")){
+ Swap(1);
+ }
+ if(Input.GetKeyUp("2")){
+ Swap(2);
+ }
+
+
+ if(batchLeft&&batchRight){
+ if(Input.GetKeyUp(KeyCode.M)){
+ batchLeft.VR_Depth = batchLeft.VR_Depth+0.05f;
+ batchLeft.VR_Depth = Mathf.Clamp01(batchLeft.VR_Depth);
+ batchRight.VR_Depth = batchLeft.VR_Depth;
+ }
+
+ if(Input.GetKeyUp(KeyCode.N)){
+ batchLeft.VR_Depth = batchLeft.VR_Depth-0.05f;
+ batchLeft.VR_Depth = Mathf.Clamp01(batchLeft.VR_Depth);
+ batchRight.VR_Depth = batchLeft.VR_Depth;
+ }
+ }
+
+ }
+ void OnGUI(){
+
+ if(hideGUI)
+ return;
+#if UNITY_5
+
+ Rect texRect = new Rect(0,GetComponent<Camera>().pixelRect.height-120,GetComponent<Camera>().pixelRect.width,120);
+
+ GUI.color = Color.white;
+
+ GUI.DrawTexture(texRect, Black);
+
+ GUIStyle LogoStyle = new GUIStyle();
+ LogoStyle.active.background = Logo;
+
+ LogoStyle.normal.background = Logo;
+ LogoStyle.richText = true;
+ LogoStyle.alignment = TextAnchor.MiddleCenter;
+ LogoStyle.normal.textColor = Color.white;
+
+ GUIStyle style = new GUIStyle();
+ style.active.background = Button1;
+ style.normal.background = Button1;
+ style.richText = true;
+ style.alignment = TextAnchor.MiddleCenter;
+ style.normal.textColor = Color.white;
+
+ GUIStyle style2 = new GUIStyle();
+ style2.active.background = Button2;
+ style2.normal.background = Button2;
+ style2.richText = true;
+ style2.alignment = TextAnchor.MiddleCenter;
+ style2.normal.textColor = Color.white;
+
+ GUIStyle style3 = new GUIStyle();
+ style3.active.background = Button3;
+ style3.normal.background = Button3;
+ style3.richText = true;
+ style3.alignment = TextAnchor.MiddleCenter;
+ style3.normal.textColor = Color.white;
+
+ GUIStyle style4 = new GUIStyle();
+ style4.active.background = INFO;
+ style4.normal.background = INFO;
+ style4.richText = true;
+ style4.alignment = TextAnchor.MiddleCenter;
+ style4.normal.textColor = Color.white;
+
+ if(GUI.Button(new Rect(20,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",LogoStyle)){
+ Application.OpenURL("http://proflares.com/store");
+ }
+
+ if(GUI.Button(new Rect(20+Button1.width,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style)){
+ Swap(1);
+ }
+
+ if(GUI.Button(new Rect(0+Button1.width*2,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style2)){
+ Swap(2);
+ }
+
+ if(GUI.Button(new Rect(0+Button1.width*3,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style3)){
+ Swap(3);
+ }
+
+ if(GUI.Button(new Rect(0+Button1.width*4,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style4)){
+ }
+
+#else
+
+ Rect texRect = new Rect(0,GetComponent<Camera>().pixelRect.height-120,GetComponent<Camera>().pixelRect.width,120);
+
+ GUI.color = Color.white;
+
+ GUI.DrawTexture(texRect, Black);
+
+ GUIStyle LogoStyle = new GUIStyle();
+ LogoStyle.active.background = Logo;
+
+ LogoStyle.normal.background = Logo;
+ LogoStyle.richText = true;
+ LogoStyle.alignment = TextAnchor.MiddleCenter;
+ LogoStyle.normal.textColor = Color.white;
+
+ GUIStyle style = new GUIStyle();
+ style.active.background = Button1;
+ style.normal.background = Button1;
+ style.richText = true;
+ style.alignment = TextAnchor.MiddleCenter;
+ style.normal.textColor = Color.white;
+
+ GUIStyle style2 = new GUIStyle();
+ style2.active.background = Button2;
+ style2.normal.background = Button2;
+ style2.richText = true;
+ style2.alignment = TextAnchor.MiddleCenter;
+ style2.normal.textColor = Color.white;
+
+ GUIStyle style3 = new GUIStyle();
+ style3.active.background = Button3;
+ style3.normal.background = Button3;
+ style3.richText = true;
+ style3.alignment = TextAnchor.MiddleCenter;
+ style3.normal.textColor = Color.white;
+
+ GUIStyle style4 = new GUIStyle();
+ style4.active.background = INFO;
+ style4.normal.background = INFO;
+ style4.richText = true;
+ style4.alignment = TextAnchor.MiddleCenter;
+ style4.normal.textColor = Color.white;
+
+ if(GUI.Button(new Rect(20,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",LogoStyle)){
+ Application.OpenURL("http://proflares.com/store");
+ }
+
+ if(GUI.Button(new Rect(20+Button1.width,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style)){
+ Swap(1);
+ }
+
+ if(GUI.Button(new Rect(0+Button1.width*2,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style2)){
+ Swap(2);
+ }
+
+ if(GUI.Button(new Rect(0+Button1.width*3,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style3)){
+ Swap(3);
+ }
+
+ if(GUI.Button(new Rect(0+Button1.width*4,GetComponent<Camera>().pixelRect.height-Button1.height,Button1.width,Button1.height),"",style4)){
+ }
+
+#endif
+
+ }
+
+ public Texture2D Black;
+ public Texture2D Logo;
+ public Texture2D Button1;
+ public Texture2D Button2;
+ public Texture2D Button3;
+ public Texture2D INFO;
+
+ void drawTexture(float x, float y, Texture2D texture) {
+ if(texture != null){
+ Rect texRect = new Rect(x,y,texture.width,texture.height);
+ GUI.color = Color.white;
+ GUI.DrawTexture(texRect, texture);
+ }
+ }
+}
diff --git a/Assets/ProFlares/DemoScripts/DemoControls.cs.meta b/Assets/ProFlares/DemoScripts/DemoControls.cs.meta
new file mode 100644
index 0000000..cc78b6d
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/DemoControls.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: defcfa9cc4dcb4446ac5f14e36139b64
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/MultiCameraDemo.cs b/Assets/ProFlares/DemoScripts/MultiCameraDemo.cs
new file mode 100644
index 0000000..c21a02e
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/MultiCameraDemo.cs
@@ -0,0 +1,101 @@
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+
+using UnityEngine;
+using System.Collections;
+
+public class MultiCameraDemo : MonoBehaviour {
+
+ public Camera camera1;
+ public Camera camera2;
+ public Camera camera3;
+ public Camera camera4;
+
+ int count;
+
+ public ProFlareBatch batch;
+ void Start(){
+ camera1.enabled = true;
+ camera2.enabled = false;
+ camera3.enabled = false;
+ camera4.enabled = false;
+ batch.SwitchCamera(camera1);
+ }
+ void Update () {
+ if(Input.GetKeyUp(KeyCode.Space)){
+ count++;
+ if(count == 4)
+ count = 0;
+
+ if(count == 0){
+
+ camera1.enabled = true;
+ camera2.enabled = false;
+ camera3.enabled = false;
+ camera4.enabled = false;
+
+ batch.SwitchCamera(camera1);
+ }
+ if(count == 1){
+
+ camera1.enabled = false;
+ camera2.enabled = true;
+ camera3.enabled = false;
+ camera4.enabled = false;
+
+ batch.SwitchCamera(camera2);
+ }
+ if(count == 2){
+
+ camera1.enabled = false;
+ camera2.enabled = false;
+ camera3.enabled = true;
+ camera4.enabled = false;
+
+ batch.SwitchCamera(camera3);
+ }
+ if(count == 3){
+
+ camera1.enabled = false;
+ camera2.enabled = false;
+ camera3.enabled = false;
+ camera4.enabled = true;
+
+ batch.SwitchCamera(camera4);
+ }
+ }
+ }
+
+
+ public Texture2D Logo;
+
+ public Texture2D Info;
+
+ void OnGUI(){
+
+ GUI.color = Color.white;
+
+ GUIStyle LogoStyle = new GUIStyle();
+ LogoStyle.active.background = Logo;
+
+ LogoStyle.normal.background = Logo;
+ LogoStyle.richText = true;
+ LogoStyle.alignment = TextAnchor.MiddleCenter;
+ LogoStyle.normal.textColor = Color.white;
+
+ if(GUI.Button(new Rect(10,0,Logo.width,Logo.height),"",LogoStyle)){
+ Application.OpenURL("http://proflares.com/store");
+ }
+
+ GUIStyle styleInfo = new GUIStyle();
+ styleInfo.active.background = Info;
+ styleInfo.normal.background = Info;
+ styleInfo.richText = true;
+ styleInfo.alignment = TextAnchor.MiddleCenter;
+ styleInfo.normal.textColor = Color.white;
+
+ if(GUI.Button(new Rect((camera1.pixelRect.width*0.5f)-(Info.width*0.5f),camera1.pixelRect.height-Info.height,Info.width,Info.height),"",styleInfo)){
+ //Application.OpenURL("http://proflares.com/store");
+ }
+ }
+}
diff --git a/Assets/ProFlares/DemoScripts/MultiCameraDemo.cs.meta b/Assets/ProFlares/DemoScripts/MultiCameraDemo.cs.meta
new file mode 100644
index 0000000..dde7a8f
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/MultiCameraDemo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6069bb6d27ddb4b21848b259bad360a0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/PresetViewer.cs b/Assets/ProFlares/DemoScripts/PresetViewer.cs
new file mode 100644
index 0000000..b313501
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/PresetViewer.cs
@@ -0,0 +1,99 @@
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+
+using UnityEngine;
+using System.Collections;
+
+public class PresetViewer : MonoBehaviour {
+
+ public Transform PresetParent;
+
+ public Camera MainCamera;
+
+ public Texture2D Logo;
+
+ public Texture2D Info;
+
+ public Texture2D Black;
+
+ int currentFlare = 0;
+ public GameObject[] Flares;
+
+
+ void Start () {
+ //return;
+
+ for(int i = 0; i < Flares.Length;i++){
+ Flares[i].SetActive(false);
+ }
+ Flares[currentFlare].SetActive(true);
+ }
+
+ // Update is called once per frame
+ void Update () {
+
+ if(Input.GetKeyUp(KeyCode.LeftArrow) || Input.GetKeyUp(KeyCode.RightArrow)){
+ for(int i = 0; i < Flares.Length;i++){
+ Flares[i].SetActive(false);
+ }
+
+ if(Input.GetKeyUp(KeyCode.LeftArrow))
+ currentFlare--;
+ else
+ currentFlare++;
+
+ if(currentFlare < 0) currentFlare = Flares.Length-1;
+ if(currentFlare > Flares.Length-1) currentFlare = 0;
+
+ Flares[currentFlare].SetActive(true);
+ }
+
+ //if(!hideGui)
+ if(Input.GetMouseButton(0)){
+ float extra = 1.2f;
+
+ Ray ray = MainCamera.ScreenPointToRay(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0));
+ Debug.DrawRay(ray.origin, ray.direction * 10, Color.yellow);
+ RaycastHit hit;
+ if(Physics.Raycast(ray,out hit)){
+ PresetParent.position = hit.point*extra;
+ }
+ }
+ }
+ public bool hideGui = false;
+ void OnGUI(){
+
+ if(hideGui)
+ return;
+
+ GUIStyle LogoStyle = new GUIStyle();
+ LogoStyle.active.background = Logo;
+ LogoStyle.normal.background = Logo;
+ LogoStyle.richText = true;
+ LogoStyle.alignment = TextAnchor.MiddleCenter;
+ LogoStyle.normal.textColor = Color.white;
+
+
+ GUIStyle styleInfo = new GUIStyle();
+ styleInfo.active.background = Info;
+ styleInfo.normal.background = Info;
+ styleInfo.richText = true;
+ styleInfo.alignment = TextAnchor.MiddleCenter;
+ styleInfo.normal.textColor = Color.white;
+
+ if(GUI.Button(new Rect(10,0,Logo.width,Logo.height),"",LogoStyle)){
+ Application.OpenURL("http://proflares.com/store");
+ }
+
+ if(GUI.Button(new Rect((MainCamera.pixelRect.width*0.5f)-(Info.width*0.5f),MainCamera.pixelRect.height-Info.height,Info.width,Info.height),"",styleInfo)){}
+
+ }
+
+ void drawTexture(float x, float y, Texture2D texture) {
+ if(texture != null){
+ Rect texRect = new Rect(x,y,texture.width,texture.height);
+ GUI.color = Color.white;
+ GUI.DrawTexture(texRect, texture);
+ }
+ }
+}
diff --git a/Assets/ProFlares/DemoScripts/PresetViewer.cs.meta b/Assets/ProFlares/DemoScripts/PresetViewer.cs.meta
new file mode 100644
index 0000000..72bf83c
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/PresetViewer.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6d89df96c71494321b58e26500581984
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/RandomPos.cs b/Assets/ProFlares/DemoScripts/RandomPos.cs
new file mode 100644
index 0000000..21cd117
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/RandomPos.cs
@@ -0,0 +1,34 @@
+using UnityEngine;
+using System.Collections;
+
+public class RandomPos : MonoBehaviour {
+
+ Transform thisTransform;
+ public float updateTime = 1;
+ public float maxRandomTime = 1.5f;
+
+ public float range = 2;
+ Vector3 startPosition;
+ // Use this for initialization
+ void Start () {
+
+ thisTransform = transform;
+ startPosition = transform.position;
+ StartCoroutine(update());
+ }
+
+ void OnEnable(){
+
+ StartCoroutine(update());
+
+ }
+
+ IEnumerator update(){
+
+ yield return new WaitForSeconds(updateTime+Random.Range(0f,maxRandomTime));
+
+ thisTransform.position = startPosition+(Vector3.left*Random.Range(-range,range))+(Vector3.up*Random.Range(-range,range))+(Vector3.back*Random.Range(-range,range));
+ StartCoroutine(update());
+ }
+
+}
diff --git a/Assets/ProFlares/DemoScripts/RandomPos.cs.meta b/Assets/ProFlares/DemoScripts/RandomPos.cs.meta
new file mode 100644
index 0000000..0bc4e12
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/RandomPos.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: affc9cd9eb66949bebeb2564770bba20
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/RotateTransform.cs b/Assets/ProFlares/DemoScripts/RotateTransform.cs
new file mode 100644
index 0000000..2f54743
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/RotateTransform.cs
@@ -0,0 +1,21 @@
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+using UnityEngine;
+using System.Collections;
+
+public class RotateTransform : MonoBehaviour {
+
+ Transform thisTransform;
+
+ public Vector3 Speed = new Vector3(0,20f,0);
+
+ void Start () {
+ thisTransform = transform;
+ }
+
+ void Update () {
+ Quaternion offset = Quaternion.Euler(Speed * Time.deltaTime);
+ thisTransform.localRotation = thisTransform.localRotation*offset;
+ }
+
+}
diff --git a/Assets/ProFlares/DemoScripts/RotateTransform.cs.meta b/Assets/ProFlares/DemoScripts/RotateTransform.cs.meta
new file mode 100644
index 0000000..c16fdb5
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/RotateTransform.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1d89303dd8d2742a8aef9c0ad9d88e57
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/SpinInput.cs b/Assets/ProFlares/DemoScripts/SpinInput.cs
new file mode 100644
index 0000000..195917f
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/SpinInput.cs
@@ -0,0 +1,129 @@
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+
+/// <summary>
+/// SpinInput.cs
+/// Rotates a transform based on click dragging. Works on ether X or Y Axis. Y Axis can be limited.
+/// </summary>
+
+using UnityEngine;
+using System.Collections;
+
+namespace ProFlares {
+public class SpinInput : MonoBehaviour {
+
+ private Transform thisTransform;
+
+ float xVerlo;
+
+ float targetVerloX;
+ float lastX;
+ float currentX;
+
+ float offsetX;
+
+ float finalVeloX;
+
+ float tempVeloX;
+
+ float YVerlo;
+
+ float targetVerloY;
+ float lastY;
+ float currentY;
+
+ float offsetY;
+
+ float finalVeloY;
+
+ float tempVeloY;
+
+ public int cropDist = 180;
+
+ public float ResponseTime = 0.2f;
+
+ public bool touchMode = true;
+ void Start () {
+ thisTransform = transform;
+ }
+
+ public bool X;
+
+ public bool Y;
+
+
+ void LateUpdate () {
+
+
+ if(X){
+
+ if(Input.GetMouseButtonDown(0)){
+ // print("MouseDown");
+ lastX = 0;
+ currentX = 0;
+ offsetX = Input.mousePosition.x;
+ }
+
+
+ if(Input.GetMouseButton(0)){
+
+ lastX = currentX;
+ currentX = Input.mousePosition.x-offsetX;
+
+ targetVerloX = (currentX-lastX)*2;
+
+ if((currentX-lastX > 1)||(currentX-lastX < -1)){
+
+ }
+ targetVerloX = targetVerloX*3.5f;
+
+ }else{
+
+ targetVerloX = targetVerloX*0.95f;
+ }
+ finalVeloX = Mathf.Lerp(finalVeloX,targetVerloX,20*Time.deltaTime);
+
+ thisTransform.Rotate(0,finalVeloX*Time.deltaTime,0);
+ }
+
+
+
+ if(Y){
+ if(Input.GetMouseButtonDown(0)){
+ // print("MouseDown");
+ lastY = 0;
+ currentY = 0;
+ offsetY = Input.mousePosition.y;
+ }
+
+ if(Input.GetMouseButton(0)){
+
+ lastY = currentY;
+ currentY = Input.mousePosition.y-offsetY;
+
+ targetVerloY = (currentY-lastY)*-2;
+ targetVerloY = targetVerloY*1.5f;
+
+ }else{
+
+ targetVerloY = targetVerloY*0.95f;
+ }
+
+
+ finalVeloY = Mathf.Lerp(finalVeloY,targetVerloY,20*Time.deltaTime);
+
+
+ thisTransform.Rotate(finalVeloY*Time.deltaTime,0,0);
+
+
+ Quaternion newrotation = thisTransform.rotation;
+
+ newrotation.x = Mathf.Clamp(newrotation.x,-0.1f,0.3f);
+
+ thisTransform.rotation = newrotation;
+
+ }
+
+ }
+ }
+} \ No newline at end of file
diff --git a/Assets/ProFlares/DemoScripts/SpinInput.cs.meta b/Assets/ProFlares/DemoScripts/SpinInput.cs.meta
new file mode 100644
index 0000000..682d0ba
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/SpinInput.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1a921a8497aac47309e350980e0a7cf1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/SplitScreenDemo.cs b/Assets/ProFlares/DemoScripts/SplitScreenDemo.cs
new file mode 100644
index 0000000..ac13675
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/SplitScreenDemo.cs
@@ -0,0 +1,53 @@
+
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+
+
+using UnityEngine;
+using System.Collections;
+
+public class SplitScreenDemo : MonoBehaviour {
+
+ // Use this for initialization
+ void Start () {
+
+ }
+
+ // Update is called once per frame
+ void Update () {
+
+ }
+
+ public Camera guiCamera;
+ public Texture2D Logo;
+
+ public Texture2D Info;
+
+ void OnGUI(){
+
+ GUI.color = Color.white;
+
+ GUIStyle LogoStyle = new GUIStyle();
+ LogoStyle.active.background = Logo;
+
+ LogoStyle.normal.background = Logo;
+ LogoStyle.richText = true;
+ LogoStyle.alignment = TextAnchor.MiddleCenter;
+ LogoStyle.normal.textColor = Color.white;
+
+ if(GUI.Button(new Rect(10,0,Logo.width,Logo.height),"",LogoStyle)){
+ Application.OpenURL("http://proflares.com/store");
+ }
+
+ GUIStyle styleInfo = new GUIStyle();
+ styleInfo.active.background = Info;
+ styleInfo.normal.background = Info;
+ styleInfo.richText = true;
+ styleInfo.alignment = TextAnchor.MiddleCenter;
+ styleInfo.normal.textColor = Color.white;
+
+ if(GUI.Button(new Rect((guiCamera.pixelRect.width*0.5f)-(Info.width*0.5f),guiCamera.pixelRect.height*2-Info.height,Info.width,Info.height),"",styleInfo)){
+ //Application.OpenURL("http://proflares.com/store");
+ }
+ }
+}
diff --git a/Assets/ProFlares/DemoScripts/SplitScreenDemo.cs.meta b/Assets/ProFlares/DemoScripts/SplitScreenDemo.cs.meta
new file mode 100644
index 0000000..1905f67
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/SplitScreenDemo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f82ab4ac698344a89b954007022764ff
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
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;
+
+ }
+ }
+ }
+}
diff --git a/Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs.meta b/Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs.meta
new file mode 100644
index 0000000..d82264b
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/SwitchCameraDemo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 146d1f3d1abb64eb293a4bb0ce974f22
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/TranslateCurve.cs b/Assets/ProFlares/DemoScripts/TranslateCurve.cs
new file mode 100644
index 0000000..32619ae
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/TranslateCurve.cs
@@ -0,0 +1,26 @@
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+
+using UnityEngine;
+using System.Collections;
+
+namespace ProFlares {
+ public class TranslateCurve : MonoBehaviour {
+ Transform thisTransform;
+ Vector3 pos;
+ public float speed = 0.3f;
+ public WrapMode wrapMode;
+ public Vector3 axis = Vector3.one;
+
+ public AnimationCurve Curve = new AnimationCurve(new Keyframe(0, 0.1f), new Keyframe(0.5f, 1.0f), new Keyframe(1.0f, 0.1f));
+ void Start () {
+ thisTransform = transform;
+ pos = thisTransform.localPosition;
+ Curve.postWrapMode = wrapMode;
+ }
+
+ void Update () {
+ thisTransform.transform.localPosition = pos+(axis*Curve.Evaluate(Time.time*speed));
+ }
+ }
+}
diff --git a/Assets/ProFlares/DemoScripts/TranslateCurve.cs.meta b/Assets/ProFlares/DemoScripts/TranslateCurve.cs.meta
new file mode 100644
index 0000000..6649aed
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/TranslateCurve.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 901175919919246c990a265e0749f65a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/ProFlares/DemoScripts/Zoom.cs b/Assets/ProFlares/DemoScripts/Zoom.cs
new file mode 100644
index 0000000..5caece9
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/Zoom.cs
@@ -0,0 +1,47 @@
+/// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
+
+/// <summary>
+/// Zoom.cs
+/// Attach to a transform, which will then move in on the Z Axis when the mouse wheel is used.
+/// </summary>
+using UnityEngine;
+using System.Collections;
+
+namespace ProFlares{
+ public class Zoom : MonoBehaviour {
+
+ Transform thisTrans;
+
+ public float current;
+
+ public float prev;
+
+ void Start () {
+ thisTrans = transform;
+ }
+
+ public float pos = 0;
+
+ public float dif;
+
+ public float offset;
+
+ void Update () {
+ prev = current;
+ current = Input.GetAxis("Mouse ScrollWheel");
+
+ if(Input.GetKey(KeyCode.UpArrow))
+ current = 0.1f;
+
+ if(Input.GetKey(KeyCode.DownArrow))
+ current = -0.1f;
+
+ dif = (prev-current)*-0.3f;
+ pos = Mathf.Clamp(pos + dif,-1f,1f);
+
+ Vector3 newPos = thisTrans.localPosition;
+ newPos.z = Mathf.Clamp(thisTrans.localPosition.z+current,-2f,3f);
+ thisTrans.localPosition = newPos;
+ }
+ }
+}
diff --git a/Assets/ProFlares/DemoScripts/Zoom.cs.meta b/Assets/ProFlares/DemoScripts/Zoom.cs.meta
new file mode 100644
index 0000000..3894500
--- /dev/null
+++ b/Assets/ProFlares/DemoScripts/Zoom.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7273bde5c1c224e26b0efa033fe287fd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: