-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made BTRoot cleanups and made it to not check for entry point in processing.
- Loading branch information
1 parent
32e57b2
commit 6642533
Showing
4 changed files
with
56 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extends Node2D | ||
|
||
|
||
@onready var bt_root: BTRoot = $BTRoot as BTRoot | ||
|
||
|
||
func _unhandled_input(event: InputEvent) -> void: | ||
if Input.is_action_just_pressed("ui_accept"): | ||
if bt_root.active == true: | ||
bt_root.active = false | ||
else: | ||
bt_root.active = true | ||
|
||
if Input.is_action_just_pressed("ui_left"): | ||
var lp = LeafPrint.new() | ||
lp.custom_text = "I'm a leaf." | ||
bt_root.add_child(lp) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://bb5leiis4ldhe"] | ||
|
||
[ext_resource type="Script" path="res://tmp/test.gd" id="1_7baav"] | ||
[ext_resource type="Script" path="res://addons/behaviour_toolkit/behaviour_tree/bt_root.gd" id="2_efrcf"] | ||
|
||
[node name="Test" type="Node2D"] | ||
script = ExtResource("1_7baav") | ||
|
||
[node name="BTRoot" type="Node" parent="."] | ||
script = ExtResource("2_efrcf") |