UniRxでTimer処理を行う方法
Observable.Interval(TimeSpan.FromMilliseconds(1000)).Subscribe(l => { //Something Do }).AddTo(this);
TimeSpan.FromMilliseconds(1000)で、ミリ秒で待ち時間を設定する。
UniRxでTimer処理を行う方法
Observable.Interval(TimeSpan.FromMilliseconds(1000)).Subscribe(l => { //Something Do }).AddTo(this);
TimeSpan.FromMilliseconds(1000)で、ミリ秒で待ち時間を設定する。
c#で、時計表記などで、”1″を”01″などと2桁表示する方法
int num = 1; string str = num.ToString("00"); // 01となる
Edit Modeでも、GameObjectの状態を確認したり、パラメーターで生成/変化させるのに便利。
using UnityEngine; using System.Collections; [ExecuteInEditMode] public class ExampleClass : MonoBehaviour { void Update() { } }
https://docs.unity3d.com/jp/540/ScriptReference/ExecuteInEditMode.html
半径1の球体の中でランダムな位置を取得できる
transform.position = Random.insideUnitSphere
アプリケーションに埋め込んでも良いフリーフォント集
https://www.fontsquirrel.com/