Warning: Declaration of action_plugin_linebreak::register(&$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /home/stepism/www/ue4/wiki/lib/plugins/linebreak/action.php on line 41

Warning: Declaration of action_plugin_markdownextra::register(&$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /home/stepism/www/ue4/wiki/lib/plugins/markdownextra/action.php on line 16

Warning: Declaration of action_plugin_syntaxhighlighter3_action::register(Doku_Event_Handler &$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /home/stepism/www/ue4/wiki/lib/plugins/syntaxhighlighter3/action/action.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /home/stepism/www/ue4/wiki/lib/plugins/linebreak/action.php:0) in /home/stepism/www/ue4/wiki/inc/auth.php on line 430

Warning: Declaration of syntax_plugin_linebreak::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /home/stepism/www/ue4/wiki/lib/plugins/linebreak/syntax.php on line 52

Warning: Declaration of syntax_plugin_linebreak::render($mode, &$renderer, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /home/stepism/www/ue4/wiki/lib/plugins/linebreak/syntax.php on line 74

Warning: Cannot modify header information - headers already sent by (output started at /home/stepism/www/ue4/wiki/lib/plugins/linebreak/action.php:0) in /home/stepism/www/ue4/wiki/inc/actions.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /home/stepism/www/ue4/wiki/lib/plugins/linebreak/action.php:0) in /home/stepism/www/ue4/wiki/lib/tpl/dokuwiki/main.php on line 12
005 インターフェースについて(4.7.6) [stepism@UE4メモ]

ユーザ用ツール

サイト用ツール


wiki:ue4:tips:105

005 インターフェースについて(4.7.6)

BPにもインターフェースクラスが存在します。ここでは使い方のみ説明します。より詳細な部分はブループリント インターフェースについて - Let's Enjoy Unreal Engineがとても参考になります。

インターフェースBPの作成

コンテンツブラウザから、新規作成 → ブループリント →ブループリントインターフェースを選択する。BPインターフェースの名前はICommandとしておきます。






インターフェースの実装

作成したBPインターフェースを編集します。


ツールバーのクラス設定を開き、詳細パネルから関数を登録します。入力値は文字列の配列を引数にしています。出力値は文字列を返す様にしています。UE4のバージョン(4.7.6)では出力値を必ず一つ設定しておかないと、インターフェース扱いにならずイベント扱いになってしまいますので文字列を返す様にしておきます。






関数の実装

コンテンツブラウザから、新規作成 → ブループリント → Actorを継承しただけのBP「WaitCommand」を作成します。次に、WaitCommandの関数を実装します。編集画面のツールバー → クラス設定の詳細パネルから実装インターフェース「ICommand」を追加します。これで「ICommand」を継承した形になるので、関数の中身を実装します。

きちんと処理が通るか確認するため、文字列を出すだけのノードを追加しています。






使ってみる

あとは、作成した「WaitCommand」クラスはActorを継承しているので、SpawnActorで生成して関数を呼び出すだけです。

wiki/ue4/tips/105.txt · 最終更新: 2015/06/24 09:02 by step