Application.targetFrameRate=60,意思就是每秒钟会刷新60帧,也就是说每秒钟会执行Update中的代码60次。(不过不是严格执行,只是尽量往60帧靠)
Time.deltaTime是计算时间间隔
Time.time是计算时间累计
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleLogic : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Application.targetFrameRate = 60;
}
// Update is called once per frame
void Update()
{
Debug.Log("帧更新!"+"时间间隔:"+Time.deltaTime+" 时间累计:"+Time.time);
}
}