Version: 2020.1
言語: 日本語
public static int frameCount ;

説明

経過したフレーム数の合計(Read Only)

using UnityEngine;

public class Example : MonoBehaviour { // Makes sure that RecalculateValue only performs // some operations once per frame and no more. static private int lastRecalculation = -1;

static void RecalculateValue() { if (lastRecalculation == Time.frameCount) return; // ProcessData.AndDoSomeCalculations(); } }

注: すべての Awake 関数がいったん完了してから frameCount は開始します。 Awake 関数の実行中は frameCount 値は定義できません。