*
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class RotationAnimation : MonoBehaviour
|
||||
{
|
||||
public Vector3 axis = Vector3.right;
|
||||
public float angle;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update ()
|
||||
{
|
||||
transform.localRotation = Quaternion.AngleAxis(angle*Time.deltaTime, axis.normalized)* transform.localRotation;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user