Added full module example
This commit is contained in:
parent
f3c2d8e2b6
commit
b74d9b203c
35 changed files with 92 additions and 40 deletions
28
examples/godot_examples/godot_resources/scripts/CustomModuleExampleScene.gd
Executable file
28
examples/godot_examples/godot_resources/scripts/CustomModuleExampleScene.gd
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
extends Node2D
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
print("hello")
|
||||
|
||||
# Use existing node
|
||||
print($CustomKomputeNode.get_total())
|
||||
|
||||
$CustomKomputeNode.add(10)
|
||||
print($CustomKomputeNode.get_total())
|
||||
|
||||
$CustomKomputeNode.add(10)
|
||||
print($CustomKomputeNode.get_total())
|
||||
|
||||
# Create new instance
|
||||
var s = KomputeSummatorNode.new()
|
||||
|
||||
# This will print 0 as it's a new instance
|
||||
print(s.get_total())
|
||||
|
||||
# Now we can again send further commands
|
||||
s.add(10)
|
||||
print(s.get_total())
|
||||
|
||||
s.add(10)
|
||||
print(s.get_total())
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue