diff --git a/Assets/Background.cs b/Assets/Background.cs new file mode 100644 index 0000000..615af01 --- /dev/null +++ b/Assets/Background.cs @@ -0,0 +1,25 @@ +using UnityEngine; +using System.Collections; + +public class Background : MonoBehaviour { + + public float rotationSpeed = 1.0f; + public float rotationDirection = 1.0f; + public bool RandomRotationSpeed = true; + + // Use this for initialization + public void Start () { + + + if (RandomRotationSpeed) + rotationSpeed = 10 * UnityEngine.Random.Range(0.25f, 1f); + + rotationDirection = (Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f)) * 2 - 1); + } + + // Update is called once per frame + public void FixedUpdate () { + + this.transform.Rotate(new Vector3(0, 0, 1.0f), rotationDirection * rotationSpeed * Time.deltaTime); + } +} diff --git a/Assets/Background.cs.meta b/Assets/Background.cs.meta new file mode 100644 index 0000000..523ee59 --- /dev/null +++ b/Assets/Background.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f0e11200b6b1f54479582f86a7d397b4 +timeCreated: 1460162938 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: