Stratasys-450mc-VR/Assets/Scripts/RotateTarget.cs

25 lines
530 B
C#
Raw Normal View History

using System;
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
using UnityEngine.XR.Content.Interaction;
public class RotateTarget : MonoBehaviour
{
[SerializeField] private Transform target;
[SerializeField] private float speed = 10f;
[SerializeField] private Vector3 rotationAxis = Vector3.right;
public void Rotate(float amount)
{
amount *= Time.deltaTime;
2023-11-14 11:51:12 -05:00
amount *= speed;
2023-11-14 11:51:12 -05:00
target.Rotate(rotationAxis,amount);
2023-11-14 11:51:12 -05:00
}
}