Finish persistent data
This commit is contained in:
parent
7753ed8b87
commit
cdb1ae3129
@ -70,53 +70,53 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
|
||||
[node name="Rig" parent="RigPivot" instance=ExtResource("3_n52bt")]
|
||||
|
||||
[node name="Skeleton3D" parent="RigPivot/Rig/CharacterRig/GameRig" index="0"]
|
||||
bones/0/position = Vector3(4.44089e-15, 0.910675, -0.0481736)
|
||||
bones/0/position = Vector3(4.62619e-15, 0.893026, -0.0481735)
|
||||
bones/0/rotation = Quaternion(0.12582, 1.18262e-07, 1.49989e-08, 0.992053)
|
||||
bones/1/rotation = Quaternion(-0.0566577, -0.00072973, -0.0117082, 0.998325)
|
||||
bones/2/position = Vector3(3.20474e-09, 0.146689, -1.95578e-08)
|
||||
bones/2/rotation = Quaternion(0.00704413, -0.000272063, 0.00321107, 0.99997)
|
||||
bones/2/rotation = Quaternion(-0.00439847, -0.000457517, 0.00321563, 0.999985)
|
||||
bones/3/position = Vector3(-2.01263e-09, 0.202058, -2.51457e-08)
|
||||
bones/3/rotation = Quaternion(-0.0885404, -0.000276658, 0.00852481, 0.996036)
|
||||
bones/3/rotation = Quaternion(-0.0988097, -0.000410206, 0.0085185, 0.99507)
|
||||
bones/4/position = Vector3(3.02934e-10, 0.0925562, 3.91155e-08)
|
||||
bones/4/rotation = Quaternion(0.269911, 1.44047e-08, 9.16755e-08, 0.962885)
|
||||
bones/4/rotation = Quaternion(0.279283, 1.41571e-08, 9.64292e-08, 0.960209)
|
||||
bones/5/rotation = Quaternion(-0.0948564, -2.80691e-14, -2.26155e-08, 0.995491)
|
||||
bones/6/rotation = Quaternion(-0.16516, -1.17572e-07, -1.96886e-08, 0.986267)
|
||||
bones/7/position = Vector3(-2.98252e-08, 0.910675, -0.0481735)
|
||||
bones/6/rotation = Quaternion(-0.153387, -1.18187e-07, -1.57803e-08, 0.988166)
|
||||
bones/7/position = Vector3(-3.9932e-08, 0.893026, -0.0481734)
|
||||
bones/7/rotation = Quaternion(-0.0863677, -0.751104, -0.383052, 0.530711)
|
||||
bones/8/position = Vector3(-6.19506e-08, 0.910675, -0.0481735)
|
||||
bones/8/position = Vector3(-6.52508e-08, 0.893026, -0.0481735)
|
||||
bones/8/rotation = Quaternion(-0.0863677, 0.751104, 0.383052, 0.530711)
|
||||
bones/9/position = Vector3(0.131144, 0.976879, -0.0351291)
|
||||
bones/9/rotation = Quaternion(0.994302, 0.0202187, -0.0312623, 0.0998906)
|
||||
bones/9/position = Vector3(0.131144, 0.95923, -0.0351291)
|
||||
bones/9/rotation = Quaternion(0.992586, 0.0210874, -0.0308486, 0.115655)
|
||||
bones/10/position = Vector3(-2.36129e-08, 0.26601, -2.14789e-08)
|
||||
bones/10/rotation = Quaternion(-3.13921e-08, -0.000695086, 1.20449e-08, 1)
|
||||
bones/11/position = Vector3(-4.6306e-08, 0.26601, 2.42145e-08)
|
||||
bones/11/rotation = Quaternion(0.393701, -0.000694664, 0.000297644, 0.919238)
|
||||
bones/11/rotation = Quaternion(0.429426, -0.000700636, 0.000333309, 0.903102)
|
||||
bones/12/position = Vector3(3.05151e-08, 0.22603, 5.03768e-08)
|
||||
bones/12/rotation = Quaternion(-8.19226e-09, -0.00710644, 4.16102e-08, 0.999975)
|
||||
bones/13/position = Vector3(-2.95495e-08, 0.22603, 2.68392e-09)
|
||||
bones/13/rotation = Quaternion(-0.740256, 0.0118436, 0.0243586, 0.67178)
|
||||
bones/13/rotation = Quaternion(-0.755534, 0.0119, 0.0244256, 0.654546)
|
||||
bones/14/position = Vector3(-3.05481e-08, 0.139877, 1.64787e-08)
|
||||
bones/14/rotation = Quaternion(-9.66743e-05, 0.967474, -0.252972, -0.000383447)
|
||||
bones/15/position = Vector3(-0.131144, 0.976879, -0.0351291)
|
||||
bones/15/rotation = Quaternion(0.975928, -0.00525603, 0.0276871, 0.216262)
|
||||
bones/15/position = Vector3(-0.131144, 0.95923, -0.0351291)
|
||||
bones/15/rotation = Quaternion(0.9722, -0.00596806, 0.0271927, 0.232489)
|
||||
bones/16/position = Vector3(-1.10042e-08, 0.265705, -3.31989e-08)
|
||||
bones/16/rotation = Quaternion(-3.43227e-08, 0.00314323, 8.33075e-10, 0.999995)
|
||||
bones/17/position = Vector3(1.83545e-08, 0.265705, 6.98543e-10)
|
||||
bones/17/rotation = Quaternion(0.420029, 0.00314826, -0.00145723, 0.907504)
|
||||
bones/17/rotation = Quaternion(0.452894, 0.00334266, -0.00169809, 0.891557)
|
||||
bones/18/position = Vector3(1.2807e-08, 0.225719, -8.28774e-09)
|
||||
bones/18/rotation = Quaternion(-2.29017e-08, -0.00785732, 3.30149e-08, 0.999969)
|
||||
bones/19/position = Vector3(-1.27748e-08, 0.225719, 1.12004e-08)
|
||||
bones/19/rotation = Quaternion(-0.677559, -0.0281353, -0.00148719, 0.734928)
|
||||
bones/19/rotation = Quaternion(-0.691929, -0.0282123, -0.000465582, 0.721414)
|
||||
bones/20/position = Vector3(-1.30142e-08, 0.139877, -2.77457e-09)
|
||||
bones/20/rotation = Quaternion(-9.96472e-05, 0.967461, -0.253021, -0.000383039)
|
||||
bones/21/position = Vector3(0.0251286, 1.44019, 0.047349)
|
||||
bones/21/rotation = Quaternion(-0.46971, -0.267556, -0.41734, 0.730489)
|
||||
bones/22/position = Vector3(0.191561, 1.47923, -0.00940303)
|
||||
bones/22/rotation = Quaternion(0.0202643, -0.164169, 0.975506, -0.145005)
|
||||
bones/21/position = Vector3(0.0251286, 1.42344, 0.0409816)
|
||||
bones/21/rotation = Quaternion(-0.499619, -0.255336, -0.395443, 0.727193)
|
||||
bones/22/position = Vector3(0.187608, 1.45956, -0.0278319)
|
||||
bones/22/rotation = Quaternion(0.058024, -0.15843, 0.973989, -0.151253)
|
||||
bones/23/position = Vector3(-5.41331e-09, 0.143946, -2.98023e-08)
|
||||
bones/23/rotation = Quaternion(7.48446e-08, -0.0400679, 5.54183e-08, 0.999197)
|
||||
bones/23/rotation = Quaternion(4.96073e-08, -0.00927446, -8.03442e-09, 0.999957)
|
||||
bones/24/position = Vector3(-6.33301e-08, 0.143946, 4.3873e-08)
|
||||
bones/24/rotation = Quaternion(0.353683, -0.0400797, -0.0220808, 0.934245)
|
||||
bones/24/rotation = Quaternion(0.283657, -0.00927511, -0.0170828, 0.958729)
|
||||
bones/25/position = Vector3(1.30385e-08, 0.127601, 6.51926e-09)
|
||||
bones/25/rotation = Quaternion(1.49943e-07, -1.20606e-07, 9.91859e-08, 1)
|
||||
bones/26/position = Vector3(2.06034e-08, 0.127601, 2.42761e-08)
|
||||
@ -141,14 +141,14 @@ bones/42/rotation = Quaternion(-0.120913, 0.799109, 0.0358921, 0.587807)
|
||||
bones/43/rotation = Quaternion(0.498693, -0.0202705, -0.0256953, 0.866161)
|
||||
bones/44/rotation = Quaternion(0.715385, 0.035306, 0.0573145, 0.695481)
|
||||
bones/45/rotation = Quaternion(-0.129059, 0.728936, -0.0250259, 0.67184)
|
||||
bones/46/position = Vector3(-0.0113635, 1.44019, 0.047349)
|
||||
bones/46/rotation = Quaternion(-0.469404, 0.266039, 0.416933, 0.731471)
|
||||
bones/47/position = Vector3(-0.177613, 1.47939, -0.00982476)
|
||||
bones/47/rotation = Quaternion(-0.00840254, -0.14808, 0.976077, 0.158982)
|
||||
bones/46/position = Vector3(-0.0113635, 1.42344, 0.0409816)
|
||||
bones/46/rotation = Quaternion(-0.523521, 0.206739, 0.362067, 0.743029)
|
||||
bones/47/position = Vector3(-0.163448, 1.4598, -0.0483935)
|
||||
bones/47/rotation = Quaternion(-0.0947879, -0.133423, 0.9715, 0.171469)
|
||||
bones/48/position = Vector3(1.88476e-07, 0.143946, 1.02445e-08)
|
||||
bones/48/rotation = Quaternion(-1.14487e-07, 0.0586796, -1.06087e-07, 0.998277)
|
||||
bones/48/rotation = Quaternion(7.54982e-08, 0.000191663, 7.06355e-08, 1)
|
||||
bones/49/position = Vector3(6.5191e-09, 0.143946, -1.95094e-08)
|
||||
bones/49/rotation = Quaternion(0.394639, 0.0586801, 0.0278018, 0.916539)
|
||||
bones/49/rotation = Quaternion(0.314186, 0.000192026, 0.0286654, 0.948928)
|
||||
bones/50/position = Vector3(-1.48779e-07, 0.1276, 5.9139e-08)
|
||||
bones/50/rotation = Quaternion(-8.73115e-08, 2.7474e-08, -1.28057e-07, 1)
|
||||
bones/51/position = Vector3(1.9461e-07, 0.127601, 6.06248e-08)
|
||||
@ -174,19 +174,19 @@ bones/67/rotation = Quaternion(0.108364, -0.768224, 0.166291, 0.608635)
|
||||
bones/68/rotation = Quaternion(0.629954, 0.0295149, 0.0177509, 0.775869)
|
||||
bones/69/rotation = Quaternion(0.816678, -0.0439534, -0.0509861, 0.573155)
|
||||
bones/70/rotation = Quaternion(-0.12906, -0.728937, 0.0250258, 0.67184)
|
||||
bones/71/position = Vector3(0.127191, 1.36142, -0.0243782)
|
||||
bones/71/rotation = Quaternion(2.03347e-08, 0.598037, 0.801468, -4.58396e-08)
|
||||
bones/72/position = Vector3(-0.113426, 1.36142, -0.0243782)
|
||||
bones/72/rotation = Quaternion(2.03348e-08, 0.598037, 0.801468, -4.58395e-08)
|
||||
bones/71/position = Vector3(0.127191, 1.34114, -0.0268942)
|
||||
bones/71/rotation = Quaternion(1.90288e-08, 0.617118, 0.786871, -4.65684e-08)
|
||||
bones/72/position = Vector3(-0.113426, 1.34114, -0.0268943)
|
||||
bones/72/rotation = Quaternion(1.90289e-08, 0.617118, 0.786871, -4.65683e-08)
|
||||
|
||||
[node name="RightHandBone" parent="RigPivot/Rig" index="2"]
|
||||
transform = Transform3D(-0.962344, -0.270799, -0.0237172, 0.220499, -0.828653, 0.514504, -0.15898, 0.4899, 0.857159, -0.351429, 1.01356, 0.031865)
|
||||
transform = Transform3D(-0.962343, -0.2708, -0.0237162, 0.245724, -0.903896, 0.350132, -0.116253, 0.33112, 0.9364, -0.337264, 0.974538, -0.0460815)
|
||||
|
||||
[node name="LeftHandBone" parent="RigPivot/Rig" index="3"]
|
||||
transform = Transform3D(-0.970465, 0.23928, 0.030714, -0.208375, -0.895578, 0.39309, 0.121565, 0.375081, 0.918986, 0.348415, 0.996086, -0.00597102)
|
||||
transform = Transform3D(-0.970513, 0.239108, 0.0305218, -0.224598, -0.94298, 0.245652, 0.0875187, 0.231554, 0.968877, 0.344418, 0.963995, -0.0601631)
|
||||
|
||||
[node name="RayAttachment" type="BoneAttachment3D" parent="RigPivot/Rig"]
|
||||
transform = Transform3D(-0.962344, -0.270799, -0.0237172, 0.220499, -0.828653, 0.514504, -0.15898, 0.4899, 0.857159, -0.351429, 1.01356, 0.031865)
|
||||
transform = Transform3D(-0.962343, -0.2708, -0.0237162, 0.245724, -0.903896, 0.350132, -0.116253, 0.33112, 0.9364, -0.337264, 0.974538, -0.0460815)
|
||||
bone_name = "DEF-hand.R"
|
||||
bone_idx = 51
|
||||
use_external_skeleton = true
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
extends Control
|
||||
|
||||
var gold: int = 0
|
||||
var current_health: float
|
||||
|
||||
@onready var inventory_node: Control = $InventoryNode
|
||||
@onready var weapon_node: Control = $WeaponNode
|
||||
@onready var shield_node: Control = $ShieldNode
|
||||
@ -11,7 +14,7 @@ func cache_gear(player: Player) -> void:
|
||||
cache_item(player.ui.inventory.get_weapon(), weapon_node)
|
||||
cache_item(player.ui.inventory.get_armor(), armor_node)
|
||||
cache_item(player.ui.inventory.get_shield(), shield_node)
|
||||
# cache_item(player.ui.inventory.gold)
|
||||
gold = player.ui.inventory.gold
|
||||
|
||||
func get_inventory() -> Array:
|
||||
return inventory_node.get_children()
|
||||
@ -31,5 +34,9 @@ func get_equipped_items() -> Array:
|
||||
return equipped_items
|
||||
|
||||
func cache_item(item: ItemIcon, storage_node: Control) -> void:
|
||||
if item:
|
||||
item.get_parent().remove_child(item)
|
||||
storage_node.add_child(item)
|
||||
|
||||
func cache_player_data(player: Player) -> void:
|
||||
current_health = player.health_component.current_health
|
||||
|
||||
@ -41,6 +41,8 @@ func _ready() -> void:
|
||||
)
|
||||
stats.update_stats.connect(ui.update_stats_display)
|
||||
ui.update_stats_display()
|
||||
if PersistentData.current_health:
|
||||
health_component.current_health = PersistentData.current_health
|
||||
SceneTransition.fade_in()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
||||
@ -123,3 +123,5 @@ func load_items_from_persistant_data() -> void:
|
||||
for item: ItemIcon in PersistentData.get_equipped_items():
|
||||
add_item(item)
|
||||
equip_item(item)
|
||||
|
||||
gold = PersistentData.gold
|
||||
|
||||
@ -14,6 +14,7 @@ func change_scene(new_scene: PackedScene, player: Player) -> void:
|
||||
tween.tween_property(fader, "color:a", 1.0, 1.0)
|
||||
tween.tween_interval(0.1)
|
||||
tween.tween_callback(func() -> void:
|
||||
PersistentData.cache_player_data(player)
|
||||
PersistentData.cache_gear(player)
|
||||
get_tree().get_root().get_node("Main").change_level(new_scene)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user