27 lines
574 B
C#
27 lines
574 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class RotateObject : MonoBehaviour
|
|
{
|
|
[SerializeField] private Transform _object;
|
|
public float XRot;
|
|
public float YRot;
|
|
public float ZRot;
|
|
|
|
Vector3 NewRot;
|
|
|
|
private void Awake()
|
|
{
|
|
if(_object == null)
|
|
{
|
|
_object = GetComponent<Transform>();
|
|
}
|
|
}
|
|
|
|
public void RotateThisObject()
|
|
{
|
|
_object.transform.localRotation = Quaternion.Euler(_object.localEulerAngles.x, YRot, _object.localEulerAngles.z);
|
|
}
|
|
}
|