Web_Rot/Assets/Scripts/ModelRot.cs
2026-04-08 11:44:20 +08:00

36 lines
768 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ModelRot : MonoBehaviour
{
[HideInInspector]
public bool isRot = false;
[HideInInspector]
public Vector3 pos;
[HideInInspector]
public Vector3 rot;
[HideInInspector]
public Vector3 scale;
private void Start()
{
pos = transform.position;
rot = transform.eulerAngles;
scale = transform.localScale;
}
void Update()
{
if (isRot)
{
transform.Rotate(-Vector3.up, 50 * Time.deltaTime, Space.World);
}
}
public void ChongZhi_BtnCallBack()
{
transform.position = pos;
transform.eulerAngles = rot;
transform.localScale = scale;
}
}