using UnityEngine; using System.Collections; public class test1 : MonoBehaviour { public float angleSpeed; void Update () { if(Input.GetKeyDown(KeyCode.UpArrow)) { float sumTime = Time.time; print("从游戏开始到当前帧所消耗的总时长:" + sumTime.ToString()); float deltaTime = Time.deltaTime; print("两帧之间的时间间隔:" + deltaTime.ToString()); } //让游戏当前对象每秒中准确的旋转30度 transform.Rotate(Vector3.up, Time.deltaTime * angleSpeed); //时间流逝的快慢 float ts = Time.timeScale; } }
时间: 2024-12-11 11:23:38