您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

34 行
828 B

using System;
using UnityEngine;
using UnityEngine.Rendering;
public class Rotator : MonoBehaviour
{
[SerializeField]
public float yDegreesPerSecond = 180;
DateTime prev = DateTime.Now;
double[] difs = new double[1000];
int count = 0;
// Update is called once per frame
void Update()
{
var now = DateTime.Now;
var dif = now - prev;
transform.localRotation *= Quaternion.Euler(0, yDegreesPerSecond * Time.deltaTime, 0);
prev = now;
if (count < difs.Length)
{
difs[count] = dif.TotalMilliseconds;
}
else
{
Debug.Log("DIFS==================");
for (int i = 0; i < difs.Length; i++)
{
Debug.Log(difs[i]+"\n");
}
}
count++;
}
}