6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Epic Games Japan #4Advent Calendar 2019

Day 20

[UE4] Android開発でお馴染みの4点タップで表示されるウィンドウ内のConsole Commandのリストをカスタムしよう!

Last updated at Posted at 2019-12-19

#はじめに
Screenshot_20191219-172016.png
Screenshot_20191219-172019.png
モバイル端末の場合、4本の指で画面を同時にタップするとConsole Commandを入力するためのConsole Windowが表示されます。更にAndroidの場合は以下のConsole Commandのリストから選択し実行することが可能です。

  • stat FPS
  • stat Anim
  • stat OpenGLRHI
  • stat VulkanRHI
  • stat DumpEvents
  • stat DumpFrame
  • stat DumpHitches
  • stat Enginestat Game
  • stat Groupedstat Hitches
  • stat InitViews
  • stat LightRendering
  • stat Memorystat Particles
  • stat SceneRendering
  • stat SceneUpdate
  • stat ShadowRendering
  • stat Slow
  • stat Streaming
  • stat StreamingDetails
  • stat Unit
  • stat UnitGraph
  • stat StartFile
  • stat StopFile
  • GameVer
  • show PostProcessing
  • stat AndroidCPU

用意されているConsole Commandはどれも有用なので助かるのですが…別のConsole Commandを使いたい時もしばしばあります。そして、そのためだけにデバッグメニューを作るのは面倒です。また、最近追加された Device Output Logを活用する手もありますが、端末単体で完結したいケースもあるかと思います。

ということで、今回はこのConsole Windowに用意されたリストにConsole Commandを追加する方法についてご紹介します。

Console WindowにConsole Commandを追加する方法

GameActivity.java
	// Console
	private static final String CONSOLE_SPINNER_ITEMS[] = {"Common Console Commands", "stat FPS", "stat Anim","stat OpenGLRHI","stat VulkanRHI","stat DumpEvents","stat DumpFrame",
		"stat DumpHitches","stat Engine","stat Game","stat Grouped","stat Hitches","stat InitViews","stat LightRendering",
		"stat Memory","stat Particles","stat SceneRendering","stat SceneUpdate","stat ShadowRendering","stat Slow",
		"stat Streaming","stat StreamingDetails","stat Unit","stat UnitGraph", "stat StartFile", "stat StopFile", "GameVer", "show PostProcessing", "stat AndroidCPU"};

Console Commandのリストは GameActivity.java で上記のようにして設定されています。

そして、このGameAcitivity.javaは「パッケージング」または「起動」の度に Engine\Build\Android\Java\src\com\epicgames\ue4\GameActivity.java.template をベースに再生成されます( UEDeployAndroid.csUpdateGameActivity関数参照 )。

GameActivity.java.template
	// Console
	private static final String CONSOLE_SPINNER_ITEMS[] = {"Common Console Commands", "stat FPS", "stat Anim","stat OpenGLRHI","stat VulkanRHI","stat DumpEvents","stat DumpFrame",
		"stat DumpHitches","stat Engine","stat Game","stat Grouped","stat Hitches","stat InitViews","stat LightRendering",
		"stat Memory","stat Particles","stat SceneRendering","stat SceneUpdate","stat ShadowRendering","stat Slow",
		"stat Streaming","stat StreamingDetails","stat Unit","stat UnitGraph", "stat StartFile", "stat StopFile", "GameVer", "show PostProcessing", "stat AndroidCPU",
		"ぼくのかんがえたさいきょうのこまんど"};

そのため、GameActivity.java.templateに対して上記のような変更を加えると…(エンジンビルド不要です)
Screenshot_20191219-175416.png
このようにConsole Commandのリストに反映されます(見切れてる!)

是非色々カスタムしてみてください!
おしまい

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?