[godot] Refactor example file layout.

This commit is contained in:
Mario Zechner 2022-04-06 11:49:16 +02:00
parent 25e55b4009
commit b01acf49fd
38 changed files with 142 additions and 142 deletions

View File

@ -1,4 +1,4 @@
extends SpineSprite
func _ready():
get_animation_state().set_animation("walk", true, 0);
func _ready():
get_animation_state().set_animation("walk", true, 0)

View File

@ -0,0 +1,10 @@
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=2]
[ext_resource path="res://assets/mix-and-match/mix-and-match.atlas" type="SpineAtlasResource" id=1]
[ext_resource path="res://assets/mix-and-match/mix-and-match-pro.json" type="SpineSkeletonFileResource" id=2]
[resource]
atlas_res = ExtResource( 1 )
skeleton_file_res = ExtResource( 2 )
animations = null
skins = null

View File

@ -0,0 +1,13 @@
[remap]
importer="spine.json"
type="SpineSkeletonFileResource"
path="res://.import/mix-and-match-pro.json-57325a5014e6fd56fc4a86824bc458ea.spjson"
[deps]
source_file="res://assets/mix-and-match/mix-and-match-pro.json"
dest_files=[ "res://.import/mix-and-match-pro.json-57325a5014e6fd56fc4a86824bc458ea.spjson" ]
[params]

View File

@ -0,0 +1,14 @@
[remap]
importer="spine.atlas"
type="SpineAtlasResource"
path="res://.import/mix-and-match.atlas-3d349b543ecdcc01fb29033adaef0841.spatlas"
[deps]
source_file="res://assets/mix-and-match/mix-and-match.atlas"
dest_files=[ "res://.import/mix-and-match.atlas-3d349b543ecdcc01fb29033adaef0841.spatlas" ]
[params]
normal_texture_prefix="n"

View File

Before

Width:  |  Height:  |  Size: 340 KiB

After

Width:  |  Height:  |  Size: 340 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/mix-and-match.png-9b5652df6ad1d929562c4c4464642a95.stex"
path="res://.import/mix-and-match.png-c2d8e28d9f2efc380ff8b95a22dadcc3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://mix-and-match/mix-and-match.png"
dest_files=[ "res://.import/mix-and-match.png-9b5652df6ad1d929562c4c4464642a95.stex" ]
source_file="res://assets/mix-and-match/mix-and-match.png"
dest_files=[ "res://.import/mix-and-match.png-c2d8e28d9f2efc380ff8b95a22dadcc3.stex" ]
[params]

View File

@ -0,0 +1,10 @@
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=2]
[ext_resource path="res://assets/raptor/raptor.atlas" type="SpineAtlasResource" id=1]
[ext_resource path="res://assets/raptor/raptor-pro.skel" type="SpineSkeletonFileResource" id=2]
[resource]
atlas_res = ExtResource( 1 )
skeleton_file_res = ExtResource( 2 )
animations = null
skins = null

View File

@ -0,0 +1,13 @@
[remap]
importer="spine.skel"
type="SpineSkeletonFileResource"
path="res://.import/raptor-pro.skel-022e23a5f5581547a2d7faa9fb2c54e3.spskel"
[deps]
source_file="res://assets/raptor/raptor-pro.skel"
dest_files=[ "res://.import/raptor-pro.skel-022e23a5f5581547a2d7faa9fb2c54e3.spskel" ]
[params]

View File

@ -0,0 +1,14 @@
[remap]
importer="spine.atlas"
type="SpineAtlasResource"
path="res://.import/raptor.atlas-66da4b831eebf404341993162ba3ddb8.spatlas"
[deps]
source_file="res://assets/raptor/raptor.atlas"
dest_files=[ "res://.import/raptor.atlas-66da4b831eebf404341993162ba3ddb8.spatlas" ]
[params]
normal_texture_prefix="n"

View File

Before

Width:  |  Height:  |  Size: 411 KiB

After

Width:  |  Height:  |  Size: 411 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/raptor.png-420f3263481783832181f91be3310d7c.stex"
path="res://.import/raptor.png-505be50f63fd1d0fb9175a9efbb9776c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://raptor/raptor.png"
dest_files=[ "res://.import/raptor.png-420f3263481783832181f91be3310d7c.stex" ]
source_file="res://assets/raptor/raptor.png"
dest_files=[ "res://.import/raptor.png-505be50f63fd1d0fb9175a9efbb9776c.stex" ]
[params]

View File

@ -0,0 +1,10 @@
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=2]
[ext_resource path="res://assets/spineboy/spineboy.atlas" type="SpineAtlasResource" id=1]
[ext_resource path="res://assets/spineboy/spineboy-pro.json" type="SpineSkeletonFileResource" id=2]
[resource]
atlas_res = ExtResource( 1 )
skeleton_file_res = ExtResource( 2 )
animations = null
skins = null

View File

@ -0,0 +1,13 @@
[remap]
importer="spine.json"
type="SpineSkeletonFileResource"
path="res://.import/spineboy-pro.json-60444223fe3960c6d4c33b92d7495419.spjson"
[deps]
source_file="res://assets/spineboy/spineboy-pro.json"
dest_files=[ "res://.import/spineboy-pro.json-60444223fe3960c6d4c33b92d7495419.spjson" ]
[params]

View File

@ -0,0 +1,13 @@
[remap]
importer="spine.skel"
type="SpineSkeletonFileResource"
path="res://.import/spineboy-pro.skel-52781a88227740d2a80cb8d7636ea22e.spskel"
[deps]
source_file="res://assets/spineboy/spineboy-pro.skel"
dest_files=[ "res://.import/spineboy-pro.skel-52781a88227740d2a80cb8d7636ea22e.spskel" ]
[params]

View File

@ -0,0 +1,14 @@
[remap]
importer="spine.atlas"
type="SpineAtlasResource"
path="res://.import/spineboy.atlas-54c12b5ff1cdaaa1b4e452a7d0d868c9.spatlas"
[deps]
source_file="res://assets/spineboy/spineboy.atlas"
dest_files=[ "res://.import/spineboy.atlas-54c12b5ff1cdaaa1b4e452a7d0d868c9.spatlas" ]
[params]
normal_texture_prefix="n"

View File

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 238 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/spineboy.png-a63588ec3a5ca6e83ef256edf38d798a.stex"
path="res://.import/spineboy.png-436dbd6da2b707b6828ede17b7871f43.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://spineboy/spineboy.png"
dest_files=[ "res://.import/spineboy.png-a63588ec3a5ca6e83ef256edf38d798a.stex" ]
source_file="res://assets/spineboy/spineboy.png"
dest_files=[ "res://.import/spineboy.png-436dbd6da2b707b6828ede17b7871f43.stex" ]
[params]

View File

@ -14,5 +14,5 @@ func _ready():
customSkin.add_skin(data.find_skin("accessories/bag"))
customSkin.add_skin(data.find_skin("accessories/hat-red-yellow"))
get_skeleton().set_skin(customSkin);
get_animation_state().set_animation("dance", true, 0)

View File

@ -1,10 +0,0 @@
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=2]
[ext_resource path="res://mix-and-match/mix-and-match.atlas" type="SpineAtlasResource" id=1]
[ext_resource path="res://mix-and-match/mix-and-match-pro.json" type="SpineSkeletonFileResource" id=2]
[resource]
atlas_res = ExtResource( 1 )
skeleton_file_res = ExtResource( 2 )
animations = null
skins = null

View File

@ -1,13 +0,0 @@
[remap]
importer="spine.json"
type="SpineSkeletonFileResource"
path="res://.import/mix-and-match-pro.json-5ca1b9fd6cb1c37bf492ced0be2e27b8.spjson"
[deps]
source_file="res://mix-and-match/mix-and-match-pro.json"
dest_files=[ "res://.import/mix-and-match-pro.json-5ca1b9fd6cb1c37bf492ced0be2e27b8.spjson" ]
[params]

View File

@ -1,14 +0,0 @@
[remap]
importer="spine.atlas"
type="SpineAtlasResource"
path="res://.import/mix-and-match.atlas-0bbed47d1d8e8f4ac037195dc25c9fd9.spatlas"
[deps]
source_file="res://mix-and-match/mix-and-match.atlas"
dest_files=[ "res://.import/mix-and-match.atlas-0bbed47d1d8e8f4ac037195dc25c9fd9.spatlas" ]
[params]
normal_texture_prefix="n"

View File

@ -1,10 +0,0 @@
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=2]
[ext_resource path="res://raptor/raptor.atlas" type="SpineAtlasResource" id=1]
[ext_resource path="res://raptor/raptor-pro.skel" type="SpineSkeletonFileResource" id=2]
[resource]
atlas_res = ExtResource( 1 )
skeleton_file_res = ExtResource( 2 )
animations = null
skins = null

View File

@ -1,13 +0,0 @@
[remap]
importer="spine.skel"
type="SpineSkeletonFileResource"
path="res://.import/raptor-pro.skel-081da74993f6ecc0a4d44df29812228b.spskel"
[deps]
source_file="res://raptor/raptor-pro.skel"
dest_files=[ "res://.import/raptor-pro.skel-081da74993f6ecc0a4d44df29812228b.spskel" ]
[params]

View File

@ -1,14 +0,0 @@
[remap]
importer="spine.atlas"
type="SpineAtlasResource"
path="res://.import/raptor.atlas-583a25d9ded86c934bc106fc3b7bf122.spatlas"
[deps]
source_file="res://raptor/raptor.atlas"
dest_files=[ "res://.import/raptor.atlas-583a25d9ded86c934bc106fc3b7bf122.spatlas" ]
[params]
normal_texture_prefix="n"

View File

@ -1,10 +1,10 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://Spineboy.gd" type="Script" id=1]
[ext_resource path="res://spineboy/spineboy-data.tres" type="SpineSkeletonDataResource" id=2]
[ext_resource path="res://mix-and-match/mix-and-match-data.tres" type="SpineSkeletonDataResource" id=3]
[ext_resource path="res://assets/spineboy/spineboy-data.tres" type="SpineSkeletonDataResource" id=2]
[ext_resource path="res://assets/mix-and-match/mix-and-match-data.tres" type="SpineSkeletonDataResource" id=3]
[ext_resource path="res://mix-and-match.gd" type="Script" id=5]
[ext_resource path="res://raptor/raprot-data.tres" type="SpineSkeletonDataResource" id=6]
[ext_resource path="res://assets/raptor/raprot-data.tres" type="SpineSkeletonDataResource" id=6]
[sub_resource type="SpineAnimationStateDataResource" id=2]
skeleton = ExtResource( 2 )
@ -29,7 +29,7 @@ scale = Vector2( 0.5, 0.5 )
animation_state_data_res = SubResource( 3 )
script = ExtResource( 5 )
[node name="SpineSprite" type="SpineSprite" parent="."]
[node name="Raptor" type="SpineSprite" parent="."]
position = Vector2( 261.223, 541.504 )
scale = Vector2( 0.5, 0.5 )
animation_state_data_res = SubResource( 5 )

View File

@ -1,10 +0,0 @@
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=2]
[ext_resource path="res://spineboy/spineboy.atlas" type="SpineAtlasResource" id=1]
[ext_resource path="res://spineboy/spineboy-pro.json" type="SpineSkeletonFileResource" id=2]
[resource]
atlas_res = ExtResource( 1 )
skeleton_file_res = ExtResource( 2 )
animations = null
skins = null

View File

@ -1,13 +0,0 @@
[remap]
importer="spine.json"
type="SpineSkeletonFileResource"
path="res://.import/spineboy-pro.json-32eeb9972a49130cf636442038541a01.spjson"
[deps]
source_file="res://spineboy/spineboy-pro.json"
dest_files=[ "res://.import/spineboy-pro.json-32eeb9972a49130cf636442038541a01.spjson" ]
[params]

View File

@ -1,13 +0,0 @@
[remap]
importer="spine.skel"
type="SpineSkeletonFileResource"
path="res://.import/spineboy-pro.skel-88c7de1bbf310b7c70ac742b725847b2.spskel"
[deps]
source_file="res://spineboy/spineboy-pro.skel"
dest_files=[ "res://.import/spineboy-pro.skel-88c7de1bbf310b7c70ac742b725847b2.spskel" ]
[params]

View File

@ -1,14 +0,0 @@
[remap]
importer="spine.atlas"
type="SpineAtlasResource"
path="res://.import/spineboy.atlas-0160ebf51649da264b83de15c13561f4.spatlas"
[deps]
source_file="res://spineboy/spineboy.atlas"
dest_files=[ "res://.import/spineboy.atlas-0160ebf51649da264b83de15c13561f4.spatlas" ]
[params]
normal_texture_prefix="n"

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=56 format=2]
[ext_resource path="res://tests/unit-tests.gd" type="Script" id=1]
[ext_resource path="res://spineboy/spineboy-data.tres" type="SpineSkeletonDataResource" id=2]
[ext_resource path="res://assets/spineboy/spineboy-data.tres" type="SpineSkeletonDataResource" id=2]
[sub_resource type="SpineAnimationStateDataResource" id=1]
skeleton = ExtResource( 2 )

View File

@ -37,7 +37,7 @@ void SpineSprite::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_animation_state_data_res"), &SpineSprite::get_animation_state_data_res);
ClassDB::bind_method(D_METHOD("_on_animation_data_created"), &SpineSprite::_on_animation_data_created);
ClassDB::bind_method(D_METHOD("get_skeleton"), &SpineSprite::get_skeleton);
ClassDB::bind_method(D_METHOD("get_spine_object"), &SpineSprite::get_animation_state);
ClassDB::bind_method(D_METHOD("get_animation_state"), &SpineSprite::get_animation_state);
ClassDB::bind_method(D_METHOD("_on_animation_data_changed"), &SpineSprite::_on_animation_data_changed);
ClassDB::bind_method(D_METHOD("get_bind_slot_nodes"), &SpineSprite::get_bind_slot_nodes);