clouds.js 529 B

1234567891011121314151617
  1. private var yRspeed = 1.0;
  2. private var frik = 0.5;
  3. private var xRspeed = 0.05;
  4. private var xRot : float =0.0;
  5. private var yRot : float =0.0;
  6. private var rotRand1 :float = 0.0;
  7. private var rotRand2 :float = 0.0;
  8. rotRand1 = Random.Range(0, 6);
  9. rotRand2 = Random.Range(0.5, 2);
  10. yRot = Random.Range(0.8, 3) * yRspeed;
  11. function Update () {
  12. xRot = (Mathf.Sin((Time.time + rotRand1) * frik)* (xRspeed * rotRand2) - xRot);
  13. transform.Rotate ( 0, Time.deltaTime * yRot , 0, Space.World );
  14. transform.Rotate ( xRot, 0, 0, Space.Self );
  15. }