36 lines
768 B
C#
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;
|
|
}
|
|
}
|