(スクリプト)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumLoop : MonoBehaviour
{
private int num;
private int count;
void Update()
{
count += 1;
// 100フレームごとに実行
if(count % 100 == 0)
{
// 順送りのテクニック(num内の数字が1>2>3>0>1>2・・・とループする)
num = (num + 1) % 4;
print(num);
}
}
}
(実行結果)
