以前のリビジョンの文書です
—-
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: Declaration of syntax_plugin_markdownextra::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/markdownextra/syntax.php on line
38
Warning: Declaration of syntax_plugin_markdownextra::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/markdownextra/syntax.php on line
47
Warning: Declaration of syntax_plugin_syntaxhighlighter3_syntax::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/syntaxhighlighter3/syntax/syntax.php on line
53
Warning: Declaration of syntax_plugin_syntaxhighlighter3_syntax::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/syntaxhighlighter3/syntax/syntax.php on line
82
割り当てたキーに処理を割り当てる(4.7.5)
ブループリントで対応する
C++で対応する
まず、割り当てる関数を準備しておきます。
void AMyPawn::MoveX(float AxisValue)
{
UE_LOG(LogTemp, Log, TEXT("AMyPawn::MoveX() called"));
}
void AMyPawn::MoveY(float AxisValue)
{
UE_LOG(LogTemp, Log, TEXT("AMyPawn::MoveY called"));
}
void AMyPawn::StartScaling()
{
UE_LOG(LogTemp, Log, TEXT("AMyPawn::StartScaling called"));
}
void AMyPawn::StopScaling()
{
UE_LOG(LogTemp, Log, TEXT("AMyPawn::StopScaling called"));
}
次に、ポーンクラスのSetupPlayerInputComponent等で、アクション(関数)を割り当てます。
void AMyPawn::SetupPlayerInputComponent(class UInputComponent* InputComponent)
{
Super::SetupPlayerInputComponent(InputComponent);
// 拡縮 キーアクション割り当て
InputComponent->BindAction("Scale", IE_Pressed, this, &AMyPawn::StartScaling); // 押した時
InputComponent->BindAction("Scale", IE_Released, this, &AMyPawn::StopScaling); // 離した時
// 移動キーアクションの割り当て
InputComponent->BindAxis("MoveX", this, &AMyPawn::MoveX);
InputComponent->BindAxis("MoveY", this, &AMyPawn::MoveY);
}
これで、割り当てた関数が呼ばれる様になります。
既知の問題
押しっぱなし判定について
bIsDown = true;
void AMyPawn::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
// 押しっぱなし判定
if (bIsDown)
{
UE_LOG(LogTemp, Log, TEXT("bIsDown"));
}
}
void AMyPawn::StartScaling()
{
bIsDown = true;
}
void AMyPawn::StopScaling()
{
bIsDown = false;
}