タイムスケール操作
- 停止、再開、ステップ再生
MIT License
Unity 2022.1.0b16
- Unity起動
- メニュー選択:「Window->Package Manager」
- ボタン選択:「左上の+ボタン」
- リスト選択:「Add package from git URL...」
- 上記UPMのURLを追加「 https://github.com/~~/UPM#バージョン 」
Gitクライアントがインストールされている必要がある。
/** ポーズ。ステップ再生。
*/
public sealed class Exsample : UnityEngine.MonoBehaviour
{
/** timescale
*/
private BlueBack.TimeScale.TimeScale timescale;
/** Start
*/
private void Start()
{
//timescale
this.timescale = new BlueBack.TimeScale.TimeScale();
}
/** Update
*/
private void Update()
{
//ポーズ。
if(UnityEngine.Input.GetKeyDown(UnityEngine.KeyCode.Space) == true){
this.timescale.SetPause(true);
}
//ステップ再生。
if(UnityEngine.Input.GetKeyDown(UnityEngine.KeyCode.Return) == true){
this.timescale.StepPlay();
}
}
}