2022-01-30 09:58:20 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class BGRotation : MonoBehaviour
|
|
|
|
{
|
2022-01-30 10:32:44 +00:00
|
|
|
private Vector3 rotation;
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
{
|
2022-01-30 10:34:49 +00:00
|
|
|
rotation = new Vector3(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360)) * 0.009f;
|
2022-01-30 10:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FixedUpdate()
|
2022-01-30 09:58:20 +00:00
|
|
|
{
|
2022-01-30 10:32:44 +00:00
|
|
|
transform.Rotate(rotation);
|
2022-01-30 09:58:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
|
|
{
|
|
|
|
if (other.tag == "platform")
|
|
|
|
{
|
|
|
|
Destroy(this.gameObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|