LMQT/Assets/Scripts/modelsRotate.cs
2024-12-10 09:03:45 +08:00

42 lines
757 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class modelsRotate : MonoBehaviour
{
public GameObject rotate;
bool onRotate = false;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (onRotate)
{
rotate.transform.Rotate(0, .3f, 0, Space.Self);
}
}
public void modelRotate()
{
if (onRotate)
{
onRotate = false;
}
else
{
onRotate=true;
}
}
public void closeRotate()
{
onRotate = false;
rotate.transform.localEulerAngles = new Vector3(0,141,0);
}
}