{"id":613,"date":"2022-07-02T16:48:09","date_gmt":"2022-07-02T07:48:09","guid":{"rendered":"https:\/\/colory-games.net\/site\/?p=613"},"modified":"2022-08-15T16:34:30","modified_gmt":"2022-08-15T07:34:30","slug":"create-custom-node-part3","status":"publish","type":"post","link":"https:\/\/colory-games.net\/site\/create-custom-node-part3\/","title":{"rendered":"[UE5] K2Node\u3092\u7d99\u627f\u3057\u3066\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u3092\u81ea\u4f5c\u3059\u308b\uff083\uff09 \u30e1\u30cb\u30e5\u30fc\u7de8"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306e\u30e1\u30cb\u30e5\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<br>\n\u5177\u4f53\u7684\u306b\u306f\u3001\u30ce\u30fc\u30c9\u300cSequence\u300d\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306b\u8868\u793a\u3055\u308c\u308b\u30d4\u30f3\u8ffd\u52a0\uff0f\u524a\u9664\u306e\u30e1\u30cb\u30e5\u30fc\u304c\u3001\u30ce\u30fc\u30c9\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306e\u30e1\u30cb\u30e5\u30fc\u306e\u4e00\u4f8b\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/sequence_node_menu.png?ssl=1\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/sequence_node_menu.png?ssl=1\" alt=\"\u30ce\u30fc\u30c9\u300cSequence\u300d\u306e\u30e1\u30cb\u30e5\u30fc\" data-recalc-dims=\"1\"><\/a><\/p>\n<p>\u306a\u304a\u3001<a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part1\/\">\u57fa\u672c\u7de8\u306e\u8a18\u4e8b<\/a> \u3068 <a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part2\/\">\u5b9f\u884c\u30d4\u30f3\u7de8\u306e\u8a18\u4e8b<\/a> \u3092\u7406\u89e3\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u524d\u63d0\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part1\/\">K2Node\u3092\u7d99\u627f\u3057\u3066\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u3092\u81ea\u4f5c\u3059\u308b\uff081\uff09 \u57fa\u672c\u7de8<\/a><\/li>\n<li><a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part2\/\">K2Node\u3092\u7d99\u627f\u3057\u3066\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u3092\u81ea\u4f5c\u3059\u308b\uff082\uff09 \u5b9f\u884c\u30d4\u30f3\u7de8<\/a><\/li>\n<li>K2Node\u3092\u7d99\u627f\u3057\u3066\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u3092\u81ea\u4f5c\u3059\u308b\uff083\uff09 \u30e1\u30cb\u30e5\u30fc\u7de8\u3000\u3000\u2605\u672c\u8a18\u4e8b<\/li>\n<li><a href=\"https:\/\/colory-games.net\/site\/ue-create-custom-node-part4\/\">K2Node\u3092\u7d99\u627f\u3057\u3066\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u3092\u81ea\u4f5c\u3059\u308b\uff084\uff09 UI\u7de8<\/a><\/li>\n<\/ul>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#i\">\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f<\/a><\/li><li><a href=\"#i-2\">\u4f5c\u6210\u3059\u308b\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u306e\u4ed5\u69d8<\/a><\/li><li><a href=\"#i-3\">\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u4f5c\u6210<\/a><\/li><li><a href=\"#i-4\">\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u306e\u4f5c\u6210<\/a><ul><li><a href=\"#3\">3. \u30d4\u30f3\u306e\u8ffd\u52a0<\/a><\/li><li><a href=\"#4\">4. \u5b9f\u884c\u30d4\u30f3\u306e\u51e6\u7406\u5b9a\u7fa9<\/a><\/li><li><a href=\"#5\">5. \u30e1\u30cb\u30e5\u30fc\u3092\u8ffd\u52a0<\/a><\/li><\/ul><\/li><li><a href=\"#i-5\">\u4f5c\u6210\u3057\u305f\u30ce\u30fc\u30c9\u306e\u5229\u7528<\/a><\/li><\/ul><\/div>\n<h1><span id=\"i\">\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f<\/span><\/h1>\n<p>\u672c\u8a18\u4e8b\u3067\u8aac\u660e\u3059\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u306f\u3001GitHub\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/colory-games\/techblog-sample-projects\/tree\/main\/nutti\/20220702\">https:\/\/github.com\/colory-games\/techblog-sample-projects\/tree\/main\/nutti\/20220702<\/a><\/p>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u5229\u7528\u3057\u3066\u52d5\u4f5c\u78ba\u8a8d\u3059\u308b\u5834\u5408\u306f\u3001\u6b21\u306e\u624b\u9806\u306b\u5f93\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ol>\n<li>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea <code>MyManualSwitch<\/code> \u3092\u3001Unreal Engine\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308b <code>Plugins<\/code> \u306b\u914d\u7f6e\u3059\u308b<\/li>\n<li><code>.uproject<\/code> \u30d5\u30a1\u30a4\u30eb\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3001Visual Studio\u5411\u3051\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/li>\n<li>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30d3\u30eb\u30c9\u3059\u308b<\/li>\n<li><code>.uproject<\/code> \u30d5\u30a1\u30a4\u30eb\u304b\u3089Unreal Engine\u3092\u8d77\u52d5\u3057\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u300cMyManualSwitch\u300d\u3092\u6709\u52b9\u5316\u3059\u308b<\/li>\n<\/ol>\n<h1><span id=\"i-2\">\u4f5c\u6210\u3059\u308b\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u306e\u4ed5\u69d8<\/span><\/h1>\n<p>\u672c\u8a18\u4e8b\u3067\u4f5c\u6210\u3059\u308b\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u300cMyManualSwitch\u300d\u306e\u4ed5\u69d8\u3092\u6b21\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u51fa\u529b\u5074\u306b\u5b9f\u884c\u30d4\u30f3\u300cA\u300d\u300cB\u300d\u3092\u8ffd\u52a0\u3059\u308b<\/li>\n<li>\u30ce\u30fc\u30c9\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306b\u30e1\u30cb\u30e5\u30fc\u3092\u8ffd\u52a0\u3059\u308b\n<ul>\n<li>\u300cExecute A\u300d\uff1a\u5b9f\u884c\u30d4\u30f3\u300cA\u300d\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b<\/li>\n<li>\u300cExecute B\u300d\uff1a\u5b9f\u884c\u30d4\u30f3\u300cB\u300d\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1><span id=\"i-3\">\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u4f5c\u6210<\/span><\/h1>\n<p>\u57fa\u672c\u7de8\u3067\u8aac\u660e\u3057\u305f\u5185\u5bb9\u306b\u5f93\u3063\u3066\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>\n\u5177\u4f53\u7684\u306a\u4f5c\u6210\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part1\/\">\u57fa\u672c\u7de8\u306e\u8a18\u4e8b<\/a> \u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1><span id=\"i-4\">\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u306e\u4f5c\u6210<\/span><\/h1>\n<p>\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30ce\u30fc\u30c9\u306f\u3001\u6b21\u306e\u624b\u9806\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30af\u30e9\u30b9 <code>UK2Node<\/code> \u306e\u7d99\u627f<\/li>\n<li>\u57fa\u672c\u60c5\u5831\u306e\u8a2d\u5b9a<\/li>\n<li>\u30d4\u30f3\u306e\u8ffd\u52a0<\/li>\n<li>\u5b9f\u884c\u30d4\u30f3\u306e\u51e6\u7406\u5b9a\u7fa9<\/li>\n<li>\u30e1\u30cb\u30e5\u30fc\u3092\u8ffd\u52a0<\/li>\n<\/ol>\n<p>\u306a\u304a\u3001\u624b\u98061\u3068\u624b\u98062\u306b\u3064\u3044\u3066\u306f <a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part1\/\">\u57fa\u672c\u7de8\u306e\u8a18\u4e8b<\/a> \u3068\u307b\u307c\u540c\u3058\u3067\u3042\u308b\u305f\u3081\u3001\u3053\u3053\u3067\u306f\u624b\u98063\u304b\u3089\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2><span id=\"3\">3. \u30d4\u30f3\u306e\u8ffd\u52a0<\/span><\/h2>\n<p>\u4f5c\u6210\u3059\u308b\u30ce\u30fc\u30c9\u306e\u4ed5\u69d8\u3092\u6e80\u305f\u3059\u3088\u3046\u306b\u3001\u6b21\u306e\u30d4\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th><strong>\u30d4\u30f3\u540d<\/strong><\/th>\n<th><strong>\u5165\u51fa\u529b\u65b9\u5411<\/strong><\/th>\n<th><strong>\u610f\u5473<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><\/td>\n<td>\u5165\u529b<\/td>\n<td>\u30ce\u30fc\u30c9\u306e\u5b9f\u884c\u3092\u8d77\u52d5<\/td>\n<\/tr>\n<tr>\n<td>A<\/td>\n<td>\u51fa\u529b<\/td>\n<td>\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u304c <code>True<\/code> \u306e\u3068\u304d\u306b\u30d4\u30f3\u306e\u5148\u306b\u3064\u306a\u304c\u3063\u305f\u30ce\u30fc\u30c9\u3092\u5b9f\u884c<\/td>\n<\/tr>\n<tr>\n<td>B<\/td>\n<td>\u51fa\u529b<\/td>\n<td>\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u304c <code>False<\/code> \u306e\u3068\u304d\u306b\u30d4\u30f3\u306e\u5148\u306b\u3064\u306a\u304c\u3063\u305f\u30ce\u30fc\u30c9\u3092\u5b9f\u884c<\/td>\n<\/tr>\n<tr>\n<td>Switch<\/td>\n<td>\uff08\u5185\u90e8\uff09<\/td>\n<td><code>True<\/code> \u306e\u3068\u304d\u306b\u5b9f\u884c\u30d4\u30f3\u300cA\u300d\u306e\u5148\u306b\u3064\u306a\u304c\u3063\u305f\u30ce\u30fc\u30c9\u3092\u5b9f\u884c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u30d4\u30f3\u306e\u8ffd\u52a0\u51e6\u7406\u306f\u3001\u30e1\u30f3\u30d0\u95a2\u6570 <code>AllocateDefaultPins<\/code> \u306b\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-cpp\">CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Exec, UEdGraphSchema_K2::PN_Execute);\nCreatePin(EGPD_Output, UEdGraphSchema_K2::PC_Exec, APinName);\nCreatePin(EGPD_Output, UEdGraphSchema_K2::PC_Exec, BPinName);\n\n\/\/ \u5185\u90e8\u30d4\u30f3\u306e\u4f5c\u6210\nUEdGraphPin* SwitchPin = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Boolean, SwitchPinName);\nSwitchPin->DefaultValue = &quot;true&quot;;\nSwitchPin->bHidden = true;\nSwitchPin->bDefaultValueIsReadOnly = true;\nSwitchPin->bNotConnectable = true;\n<\/code><\/pre>\n<p>\u5165\u51fa\u529b\u5074\u306e\u30d4\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u51e6\u7406\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part1\/\">\u57fa\u672c\u7de8\u306e\u8a18\u4e8b<\/a> \u3068 <a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part2\/\">\u5b9f\u884c\u30d4\u30f3\u7de8\u306e\u8a18\u4e8b<\/a> \u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\u5b9f\u884c\u3059\u308b\u5b9f\u884c\u30d4\u30f3\u3092\u5207\u308a\u66ff\u3048\u308b\u30d5\u30e9\u30b0\u3092\u4fdd\u6301\u3059\u308b\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u3092\u8ffd\u52a0\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u307e\u3059\u3002<br>\n\u5185\u90e8\u30d4\u30f3\u306b\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u306b\u3064\u3044\u3066\u306f\u3001\u57fa\u672c\u7684\u306b <a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part2\/\">\u5b9f\u884c\u30d4\u30f3\u7de8\u306e\u8a18\u4e8b<\/a> \u3068\u540c\u69d8\u3067\u3059\u3002<br>\n\u305f\u3060\u3057\u30e1\u30f3\u30d0\u5909\u6570 <code>DefaultValue<\/code> \u306b\u5024 <code>&quot;true&quot;<\/code> \u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30d4\u30f3\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092 <code>true<\/code> \u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2><span id=\"4\">4. \u5b9f\u884c\u30d4\u30f3\u306e\u51e6\u7406\u5b9a\u7fa9<\/span><\/h2>\n<p>\u5b9f\u884c\u30d4\u30f3\u306e\u51e6\u7406\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<br>\n\u4eca\u56de\u4f5c\u6210\u3059\u308b\u30ce\u30fc\u30c9\u300cMyManualSwitch\u300d\u306f\u3001\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u304c <code>True<\/code> \u306e\u3068\u304d\u306b\u5b9f\u884c\u30d4\u30f3\u300cA\u300d\u306e\u5148\u306b\u3064\u306a\u304c\u3063\u305f\u30ce\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3001<code>False<\/code> \u306e\u3068\u304d\u306b\u5b9f\u884c\u30d4\u30f3\u300cB\u300d\u306e\u5148\u306b\u3064\u306a\u304c\u3063\u305f\u30ce\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br>\n\u3053\u306e\u52d5\u4f5c\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u3001<a href=\"https:\/\/colory-games.net\/site\/create-custom-node-part2\/\">\u5b9f\u884c\u30d4\u30f3\u7de8\u306e\u8a18\u4e8b<\/a> \u3067\u8aac\u660e\u3057\u305f\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u51e6\u7406\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p>\u30e1\u30f3\u30d0\u95a2\u6570 <code>Compile<\/code> \u306b\u5b9a\u7fa9\u3057\u305f\u3001\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306e\u51e6\u7406\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-cpp\">UK2Node_MyManualSwitch* MyManualSwitchNode = CastChecked(Node);\n\nUEdGraphPin* APin = MyManualSwitchNode->FindPin(APinName);\nUEdGraphPin* BPin = MyManualSwitchNode->FindPin(BPinName);\n\n\/\/ \u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5909\u6570\u3092\u53d6\u5f97\u3059\u308b\nUEdGraphPin* SwitchPin = MyManualSwitchNode->FindPin(SwitchPinName);\nUEdGraphPin* SwitchNet = FEdGraphUtilities::GetNetFromPin(SwitchPin);\nFBPTerminal* Switch = Context.NetMap.FindRef(SwitchNet);\n\n\/\/ \u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u304cFalse\u306e\u3068\u304d\u306b\u3001\u5b9f\u884c\u30d4\u30f3\u300cB\u300d\u306b\u5b9f\u884c\u5236\u5fa1\u304c\u79fb\u308b\nFBlueprintCompiledStatement&amp; GotoStatement = Context.AppendStatementForNode(MyManualSwitchNode);\nGotoStatement.Type = KCST_GotoIfNot;\nGotoStatement.LHS = Switch;\nContext.GotoFixupRequestMap.Add(&amp;GotoStatement, BPin);\n\n\/\/ \u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u304cTrue\u306e\u3068\u304d\u306b\u3001\u5b9f\u884c\u30d4\u30f3\u300cA\u300d\u306b\u5b9f\u884c\u5236\u5fa1\u304c\u79fb\u308b\nGenerateSimpleThenGoto(Context, *MyManualSwitchNode, APin);\n<\/code><\/pre>\n<p>\u5b9a\u7fa9\u3055\u308c\u305f\u51e6\u7406\u306f\u6bd4\u8f03\u7684\u5358\u7d14\u3067\u3059\u3002<br>\n\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u30bf\u30a4\u30d7 <code>KCST_GotoIfNot<\/code> \u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3001\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 <code>FBlueprintCompiledStatement<\/code> \u306e <code>LHS<\/code> \u306b\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5909\u6570\u3092\u6e21\u3059\u3053\u3068\u3067\u3001\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u304c <code>False<\/code> \u306e\u3068\u304d\u306b\u5b9f\u884c\u30d4\u30f3\u300cB\u300d\u306b\u5b9f\u884c\u5236\u5fa1\u304c\u79fb\u308b\u3068\u3044\u3046\u51e6\u7406\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002<br>\n\u5b9f\u884c\u30d4\u30f3\u300cA\u300d\u306b\u5b9f\u884c\u5236\u5fa1\u3092\u79fb\u3059\u51e6\u7406\u306f\u3001\u95a2\u6570 <code>GenerateSimpleThenGoto<\/code> \u3092\u547c\u3073\u51fa\u3057\u3066\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<h2><span id=\"5\">5. \u30e1\u30cb\u30e5\u30fc\u3092\u8ffd\u52a0<\/span><\/h2>\n<p>\u30ce\u30fc\u30c9\u300cMyManualSwitch\u300d\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306b\u8868\u793a\u3055\u308c\u308b\u30e1\u30cb\u30e5\u30fc\u306b\u5bfe\u3057\u3001\u9805\u76ee\u3092\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<br>\n\u4eca\u56de\u8ffd\u52a0\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u306f\u3001\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u72b6\u614b\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u3053\u3068\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u300cExecute A\u300d\uff1a\u5b9f\u884c\u30d4\u30f3\u300cA\u300d\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b<\/li>\n<li>\u300cExecute B\u300d\uff1a\u5b9f\u884c\u30d4\u30f3\u300cB\u300d\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b<\/li>\n<\/ul>\n<p>\u30ce\u30fc\u30c9\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306b\u8868\u793a\u3055\u308c\u308b\u30e1\u30cb\u30e5\u30fc\u3078\u9805\u76ee\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u30e1\u30f3\u30d0\u95a2\u6570 <code>GetNodeContextMenuActions<\/code> \u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3001\u9805\u76ee\u3092\u8ffd\u52a0\u3059\u308b\u51e6\u7406\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-cpp\">void UK2Node_MyManualSwitch::GetNodeContextMenuActions(class UToolMenu* Menu, class UGraphNodeContextMenuContext* Context) const\n{\n    Super::GetNodeContextMenuActions(Menu, Context);\n\n    FToolMenuSection&amp; Section = Menu->AddSection(&quot;K2NodeMyManualSwitch&quot;, NSLOCTEXT(&quot;K2Node&quot;, &quot;MyManualSwitchHeader&quot;, &quot;My Manual Switch&quot;));\n\n    \/\/ \u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\n    UEdGraphPin* Pin = FindPin(SwitchPinName);\n    bool bExecuteB = Pin->GetDefaultAsString() == &quot;true&quot;;\n\n    if (!bExecuteB)\n    {\n        \/\/ \u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u300cExecute A\u300d\u3092\u8ffd\u52a0\u3059\u308b\n        Section.AddMenuEntry(\n            &quot;ExecuteA&quot;,\n            LOCTEXT(&quot;ExecuteA&quot;, &quot;Execute A&quot;),\n            LOCTEXT(&quot;ExecuteATooltip&quot;, &quot;Switch to execute A pin&quot;),\n            FSlateIcon(),\n            FUIAction(FExecuteAction::CreateUObject(const_cast(this), &amp;UK2Node_MyManualSwitch::ToggleSwitch)));\n    }\n    else\n    {\n        \/\/ \u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u300cExecute B\u300d\u3092\u8ffd\u52a0\u3059\u308b\n        Section.AddMenuEntry(\n            &quot;ExecuteB&quot;,\n            LOCTEXT(&quot;ExecuteB&quot;, &quot;Execute B&quot;),\n            LOCTEXT(&quot;ExecuteBTooltip&quot;, &quot;Switch to execute B pin&quot;),\n            FSlateIcon(),\n            FUIAction(FExecuteAction::CreateUObject(const_cast(this), &amp;UK2Node_MyManualSwitch::ToggleSwitch)));\n    }\n}\n<\/code><\/pre>\n<p>\u6700\u521d\u306b <code>UToolMenu<\/code> \u306e\u30e1\u30f3\u30d0\u95a2\u6570 <code>AddSection<\/code> \u3092\u547c\u3073\u51fa\u3057\u3066\u30e1\u30cb\u30e5\u30fc\u306e\u30bb\u30af\u30b7\u30e7\u30f3\uff08\u69cb\u9020\u4f53 <code>FToolMenuSection<\/code>\uff09\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br>\n\u7d9a\u3044\u3066\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u3092\u53d6\u5f97\u3057\u3001\u69cb\u9020\u4f53 <code>FToolMenuSection<\/code> \u306e\u30e1\u30f3\u30d0\u95a2\u6570 <code>AddMenuEntry<\/code> \u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u306b\u3088\u3063\u3066\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br>\n\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u306b\u3088\u3063\u3066\u3001\u8ffd\u52a0\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u3092\u5909\u3048\u3066\u3044\u308b\u70b9\u306b\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30e1\u30f3\u30d0\u95a2\u6570 <code>AddSection<\/code> \u306e\u7b2c5\u5f15\u6570\u306b\u306f\u3001\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u3092 <code>&quot;true&quot;<\/code> \u304b\u3089 <code>&quot;false&quot;<\/code> \u306b\u3001\u3082\u3057\u304f\u306f <code>&quot;false&quot;<\/code> \u304b\u3089 <code>&quot;true&quot;<\/code> \u306b\u5207\u308a\u66ff\u3048\u308b\u51e6\u7406\u3092\u5b9a\u7fa9\u3057\u305f\u30e1\u30f3\u30d0\u95a2\u6570 <code>ToggleSwitch<\/code> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\n\u30e1\u30f3\u30d0\u95a2\u6570 <code>ToggleSwitch<\/code> \u306e\u5b9a\u7fa9\u3092\u6b21\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-cpp\">void UK2Node_MyManualSwitch::ToggleSwitch()\n{\n    Modify();\n\n    \/\/ \u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u3092\u5909\u66f4\u3059\u308b\n    UEdGraphPin* Pin = FindPin(SwitchPinName);\n    if (Pin->GetDefaultAsString() == &quot;true&quot;)\n    {\n        Pin->DefaultValue = &quot;false&quot;;\n    }\n    else\n    {\n        Pin->DefaultValue = &quot;true&quot;;\n    }\n\n    \/\/ \u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30a8\u30c7\u30a3\u30bf\u306b\u30c7\u30fc\u30bf\u304c\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u3092\u901a\u77e5\n    FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(GetBlueprint());\n}\n<\/code><\/pre>\n<p>\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u73fe\u5728\u306e\u5024\u3092\u78ba\u8a8d\u3057\u3001\u73fe\u5728\u306e\u5024\u3068\u53cd\u5bfe\u306b\u306a\u308b\u3088\u3046\u306b\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u95a2\u6570 <code>FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified<\/code> \u3092\u547c\u3073\u51fa\u3057\u3001\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30a8\u30c7\u30a3\u30bf\u306b\u5bfe\u3057\u3066\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30a2\u30bb\u30c3\u30c8\u304c\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u3092\u901a\u77e5\u3057\u307e\u3059\u3002<br>\n\u3053\u306e\u95a2\u6570\u3092\u547c\u3073\u51fa\u3055\u306a\u3044\u3068\u3001\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30a8\u30c7\u30a3\u30bf\u4e0a\u304b\u3089\u306f\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30a2\u30bb\u30c3\u30c8\u304c\u66f4\u65b0\u3055\u308c\u3066\u3044\u306a\u3044\u72b6\u614b\u3068\u3057\u3066\u30e6\u30fc\u30b6\u306b\u898b\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br>\n\u5177\u4f53\u7684\u306b\u306f\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30a2\u30bb\u30c3\u30c8\u304c\u5909\u66f4\u3055\u308c\u305f\u72b6\u614b\u3067\u3042\u308b\u306e\u306b\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u30dc\u30bf\u30f3\u304c\u30b3\u30f3\u30d1\u30a4\u30eb\u4e0d\u8981\u306e\u307e\u307e\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u73fe\u8c61\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<h1><span id=\"i-5\">\u4f5c\u6210\u3057\u305f\u30ce\u30fc\u30c9\u306e\u5229\u7528<\/span><\/h1>\n<p>\u4f5c\u6210\u3057\u305f\u30ce\u30fc\u30c9\u3092\u5229\u7528\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\nActor\u3092\u4f5c\u6210\u3057\u3066\u30d6\u30eb\u30fc\u30d7\u30ea\u30f3\u30c8\u30a8\u30c7\u30a3\u30bf\u3092\u958b\u304d\u3001\u53f3\u30af\u30ea\u30c3\u30af\u3067\u30e1\u30cb\u30e5\u30fc\u3092\u8868\u793a\u3057\u3066\u691c\u7d22\u30dc\u30c3\u30af\u30b9\u306b\u300cmymaualswitch\u300d\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/use_custom_node_search.png?ssl=1\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/use_custom_node_search.png?ssl=1\" alt=\"\u30ce\u30fc\u30c9\u300cMyManualSwitch\u300d\u306e\u691c\u7d22\" data-recalc-dims=\"1\"><\/a><\/p>\n<p>\u30ab\u30c6\u30b4\u30ea\u300cFlow Control\u300d\u306b\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u30ce\u30fc\u30c9\u300cMyManualSwitch\u300d\u3092\u9078\u629e\u3057\u3066\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/use_custom_node_build_actor.png?ssl=1\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/use_custom_node_build_actor.png?ssl=1\" alt=\"Actor\u306e\u4f5c\u6210\" data-recalc-dims=\"1\"><\/a><\/p>\n<p>\u4f5c\u6210\u3057\u305fActor\u3092\u30ec\u30d9\u30eb\u306b\u914d\u7f6e\u3057\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u73fe\u5728\u306e\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u306b\u3088\u3063\u3066\u5b9f\u884c\u3055\u308c\u308b\u30d4\u30f3\u304c\u5909\u5316\u3059\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<br>\n\u5185\u90e8\u30d4\u30f3\u300cSwitch\u300d\u306e\u5024\u306f\u3001\u30ce\u30fc\u30c9\u300cMyManualSwitch\u300d\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306b\u8868\u793a\u3055\u308c\u308b\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/use_custom_node_menu.png?ssl=1\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/use_custom_node_menu.png?ssl=1\" alt=\"\u30ce\u30fc\u30c9\u300cMyManualSwitch\u300d\u306e\u30e1\u30cb\u30e5\u30fc\" data-recalc-dims=\"1\"><\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u30ab\u30b9\u30bf\u30e0\u30ce\u30fc\u30c9\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306e\u30e1\u30cb\u30e5\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002  <\/p>\n","protected":false},"author":2,"featured_media":609,"comment_status":"open","ping_status":"open","sticky":false,"template":"templates\/single-home-techblog.php","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[144,49],"tags":[175],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/07\/20220702\/use_custom_node_menu.png?fit=481%2C679&ssl=1","_links":{"self":[{"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/posts\/613"}],"collection":[{"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/comments?post=613"}],"version-history":[{"count":6,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/posts\/613\/revisions"}],"predecessor-version":[{"id":963,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/posts\/613\/revisions\/963"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/media?parent=613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/categories?post=613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/tags?post=613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}