diff options
Diffstat (limited to 'Assets/ProFlares/DemoScripts/RandomPos.cs')
-rw-r--r-- | Assets/ProFlares/DemoScripts/RandomPos.cs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/Assets/ProFlares/DemoScripts/RandomPos.cs b/Assets/ProFlares/DemoScripts/RandomPos.cs deleted file mode 100644 index 21cd117..0000000 --- a/Assets/ProFlares/DemoScripts/RandomPos.cs +++ /dev/null @@ -1,34 +0,0 @@ -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()); - } - -} |