Last active
April 2, 2019 06:50
-
-
Save matsuyoro/55683d3001de1c3863dd292496932288 to your computer and use it in GitHub Desktop.
Unityアプリ開発のデバッグに使える時間操作(TimeScale)のショートカット
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
// timescaleをデバッグ用に操作 | |
public class TimeScaleEditor | |
{ | |
// 現在の2倍速に ショートカットキー「Cmd + ↑」 | |
[MenuItem("Tools/TimeScale/SpeedUpx2 %UP")] | |
static void SpeedUpx2() | |
{ | |
Time.timeScale = Time.timeScale * 2; | |
} | |
// 現在の半分の速度に ショートカットキー「Cmd + ↓」 | |
[MenuItem("Tools/TimeScale/SpeedDownx2 %DOWN")] | |
static void SpeedDownx2() | |
{ | |
Time.timeScale = Time.timeScale / 2; | |
} | |
// 速度をリセット ショートカットキー「Cmd + ←」 | |
[MenuItem("Tools/TimeScale/SpeedReset %LEFT")] | |
static void SpeedReset() | |
{ | |
Time.timeScale = 1.0f; | |
} | |
// 20倍速に 画面上部のwindowのTools/TimeScaleから選択する | |
[MenuItem("Tools/TimeScale/SpeedUpx20")] | |
static void SpeedUpx20() | |
{ | |
Time.timeScale = 20.0f; | |
} | |
// 10倍の1倍速に 画面上部のwindowのTools/TimeScaleから選択する | |
[MenuItem("Tools/TimeScale/SpeedDownx10")] | |
static void SpeedDownx10() | |
{ | |
Time.timeScale = 0.1f; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こんな感じになります。