PixelSphinx/Assets/Background.cs
Jean-Sébastien Gervais 42b7238a7f Earth crush shounds
2016-04-09 13:41:32 -04:00

26 lines
673 B
C#

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(1.25f, 3f);
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);
}
}