28 lines
649 B
C#
28 lines
649 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Rotate : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private Vector3 m_rotationSpeed;
|
|
|
|
void Start() {
|
|
if(m_rotationSpeed.x != 0) {
|
|
transform.Rotate(Random.Range(0, 360), 0, 0);
|
|
}
|
|
if(m_rotationSpeed.y != 0) {
|
|
transform.Rotate(0, Random.Range(0, 360), 0);
|
|
}
|
|
if(m_rotationSpeed.z != 0) {
|
|
transform.Rotate(0, 0, Random.Range(0, 360));
|
|
}
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
transform.Rotate(m_rotationSpeed * Time.deltaTime);
|
|
}
|
|
}
|