Time.frameCount 帧数
static var frameCount : int
Description描述
The total number of frames that have passed (Read Only).
已经传递的帧的总数(只读)。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
private static int lastRecalculation = -1;
static void RecalculateValue() {
if (typeof(lastRecalculation) == Time.frameCount)
return;
ProcessData.AndDoSomeCalculations();
}
}
// Makes sure that RecalculateValue only performs
// some operations once per frame and no more.
//确保RecalculateValue每帧只执行一次某些操作
static private var lastRecalculation = -1;
static function RecalculateValue () {
if (lastRecalculation == Time.frameCount)
return;
ProcessData.AndDoSomeCalculations();
}
最后修改:2010年12月27日 Monday 15:27