mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 08:55:35 +00:00
Fixed garbled shader sprite on player
This commit is contained in:
parent
b6cc5a00e8
commit
63ad349b42
3 changed files with 147 additions and 101 deletions
|
|
@ -2,91 +2,91 @@
|
|||
|
||||
[ext_resource type="Texture2D" uid="uid://d3he41g6x7w2x" path="res://Sprites/Actors/Cirno_Walk.png" id="1_nsg0m"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gvb6b"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nsg0m"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(0, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_smg7h"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gvb6b"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(16, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dod2v"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_smg7h"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(32, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qt0xq"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dod2v"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(48, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j8jir"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qt0xq"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(64, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6sqmb"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j8jir"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(80, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bl8yu"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6sqmb"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(96, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a680j"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bl8yu"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(112, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cab7f"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a680j"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(128, 80, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nsg0m"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cab7f"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_la2t0"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_eqxxe"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7j3x3"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j4qq6"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
region = Rect2(0, 32, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_34li8"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(0, 32, 16, 16)
|
||||
region = Rect2(16, 32, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_th8bd"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(16, 32, 16, 16)
|
||||
region = Rect2(32, 32, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qlee1"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(32, 32, 16, 16)
|
||||
region = Rect2(0, 48, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lcakh"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(0, 48, 16, 16)
|
||||
region = Rect2(16, 48, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3lcgt"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(16, 48, 16, 16)
|
||||
region = Rect2(32, 48, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_y1j67"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(32, 48, 16, 16)
|
||||
region = Rect2(0, 16, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ymhb3"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(0, 16, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nl5lm"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(16, 16, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s6kro"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nl5lm"]
|
||||
atlas = ExtResource("1_nsg0m")
|
||||
region = Rect2(32, 16, 16, 16)
|
||||
|
||||
|
|
@ -94,6 +94,9 @@ region = Rect2(32, 16, 16, 16)
|
|||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nsg0m")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gvb6b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
|
|
@ -118,9 +121,6 @@ animations = [{
|
|||
"texture": SubResource("AtlasTexture_a680j")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cab7f")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": null
|
||||
}],
|
||||
"loop": false,
|
||||
|
|
@ -129,7 +129,7 @@ animations = [{
|
|||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nsg0m")
|
||||
"texture": SubResource("AtlasTexture_cab7f")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
|
|
@ -137,13 +137,13 @@ animations = [{
|
|||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_la2t0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_eqxxe")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_7j3x3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_j4qq6")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_down",
|
||||
|
|
@ -151,13 +151,13 @@ animations = [{
|
|||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_j4qq6")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_34li8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_th8bd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qlee1")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_left",
|
||||
|
|
@ -165,13 +165,13 @@ animations = [{
|
|||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qlee1")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_lcakh")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_3lcgt")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_y1j67")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_right",
|
||||
|
|
@ -179,13 +179,13 @@ animations = [{
|
|||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_y1j67")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ymhb3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nl5lm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s6kro")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_up",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=70 format=3 uid="uid://rimplblbptcd"]
|
||||
[gd_scene format=3 uid="uid://rimplblbptcd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://88smibkin17p" path="res://Scripts/Components/FSM/3DPlayer/IsoPlayerFSMProxy.cs" id="1_cc7e7"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddwhrlrgj6i00" path="res://Sprites/Actors/Cirno.png" id="1_vex34"]
|
||||
|
|
@ -206,67 +206,57 @@ radius = 0.80566406
|
|||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_gndug"]
|
||||
|
||||
[node name="IsoPlayerFsm" type="CharacterBody3D" node_paths=PackedStringArray("PlayerFSM")]
|
||||
[node name="IsoPlayerFsm" type="CharacterBody3D" unique_id=1738019287 node_paths=PackedStringArray("PlayerFSM")]
|
||||
collision_layer = 2
|
||||
collision_mask = 1553
|
||||
script = ExtResource("1_cc7e7")
|
||||
PlayerFSM = NodePath("StateMachine")
|
||||
|
||||
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("Storage")]
|
||||
[node name="StateMachine" type="Node" parent="." unique_id=244023174 node_paths=PackedStringArray("Storage")]
|
||||
script = ExtResource("1_vsywg")
|
||||
Storage = NodePath("../Storage")
|
||||
|
||||
[node name="Init" type="Node" parent="StateMachine"]
|
||||
[node name="Init" type="Node" parent="StateMachine" unique_id=892434231]
|
||||
script = ExtResource("2_3oyrx")
|
||||
|
||||
[node name="Active" type="Node" parent="StateMachine" node_paths=PackedStringArray("_inputProvider", "AnimationProvider", "Storage", "DamageReceiver", "_moduleNodes")]
|
||||
[node name="Active" type="Node" parent="StateMachine" unique_id=1075426528 node_paths=PackedStringArray("_inputProvider", "AnimationProvider", "DamageReceiver", "_moduleNodes")]
|
||||
script = ExtResource("3_cc7e7")
|
||||
_inputProvider = NodePath("../../InputProvider")
|
||||
AnimationProvider = NodePath("../../AnimationProvider")
|
||||
Storage = NodePath("../../Storage")
|
||||
DamageReceiver = NodePath("../../DamageReceiver")
|
||||
_moduleNodes = [NodePath("../../InputProvider"), NodePath("../../MovementModule"), null, NodePath("../../InteractionController"), NodePath("../../ActivationProvider"), NodePath("../../WeaponModule"), NodePath("../../CrosshairModule"), NodePath("../../GrazingModule")]
|
||||
|
||||
[node name="Dead" type="Node" parent="StateMachine" node_paths=PackedStringArray("_motivationProvider", "_inputProvider", "_healthProvider", "_animationProvider")]
|
||||
[node name="Dead" type="Node" parent="StateMachine" unique_id=316659315]
|
||||
script = ExtResource("5_ok250")
|
||||
_motivationProvider = NodePath("../../DamageReceiver/MotivationProvider")
|
||||
_inputProvider = NodePath("../../InputProvider")
|
||||
_healthProvider = NodePath("../../DamageReceiver/HealthProvider")
|
||||
_animationProvider = NodePath("../../AnimationProvider")
|
||||
|
||||
[node name="Drowning" type="Node" parent="StateMachine" node_paths=PackedStringArray("_animationProvider")]
|
||||
[node name="Drowning" type="Node" parent="StateMachine" unique_id=404675249]
|
||||
script = ExtResource("6_nk07c")
|
||||
_animationProvider = NodePath("../../AnimationProvider")
|
||||
|
||||
[node name="Cutscene" type="Node" parent="StateMachine" node_paths=PackedStringArray("AnimationProvider", "PlayerStorage")]
|
||||
[node name="Cutscene" type="Node" parent="StateMachine" unique_id=1622994361 node_paths=PackedStringArray("AnimationProvider")]
|
||||
script = ExtResource("6_chmen")
|
||||
AnimationProvider = NodePath("../../AnimationProvider")
|
||||
PlayerStorage = NodePath("../../Storage")
|
||||
|
||||
[node name="Teleporting" type="Node" parent="StateMachine" node_paths=PackedStringArray("AnimationProvider")]
|
||||
[node name="Teleporting" type="Node" parent="StateMachine" unique_id=2109586675]
|
||||
script = ExtResource("7_nwocn")
|
||||
AnimationProvider = NodePath("../../AnimationProvider")
|
||||
|
||||
[node name="UnTeleporting" type="Node" parent="StateMachine" node_paths=PackedStringArray("AnimationProvider")]
|
||||
[node name="UnTeleporting" type="Node" parent="StateMachine" unique_id=5706813]
|
||||
script = ExtResource("8_nk07c")
|
||||
AnimationProvider = NodePath("../../AnimationProvider")
|
||||
|
||||
[node name="AnimationProvider" type="Node3D" parent="." node_paths=PackedStringArray("AnimatedSprite")]
|
||||
[node name="AnimationProvider" type="Node3D" parent="." unique_id=1401013207 node_paths=PackedStringArray("AnimatedSprite")]
|
||||
script = ExtResource("6_onfm2")
|
||||
AnimatedSprite = NodePath("AnimatedSprite3D")
|
||||
BlinkMaterial = ExtResource("7_yarib")
|
||||
|
||||
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="AnimationProvider"]
|
||||
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="AnimationProvider" unique_id=1694205501]
|
||||
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
|
||||
material_override = ExtResource("7_yarib")
|
||||
pixel_size = 0.05
|
||||
texture_filter = 0
|
||||
sprite_frames = ExtResource("12_j6bpw")
|
||||
animation = &"idle"
|
||||
frame_progress = 0.56080985
|
||||
animation = &"walk_up"
|
||||
script = ExtResource("9_yarib")
|
||||
|
||||
[node name="Legs" type="AnimatedSprite3D" parent="AnimationProvider"]
|
||||
[node name="Legs" type="AnimatedSprite3D" parent="AnimationProvider" unique_id=995566769]
|
||||
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
|
||||
visible = false
|
||||
pixel_size = 0.05
|
||||
|
|
@ -274,7 +264,7 @@ texture_filter = 0
|
|||
sprite_frames = ExtResource("7_l4f8l")
|
||||
animation = &"idle"
|
||||
|
||||
[node name="Sprite" type="Sprite3D" parent="AnimationProvider"]
|
||||
[node name="Sprite" type="Sprite3D" parent="AnimationProvider" unique_id=626690870]
|
||||
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
|
||||
visible = false
|
||||
pixel_size = 0.05
|
||||
|
|
@ -284,13 +274,12 @@ texture = ExtResource("1_vex34")
|
|||
hframes = 3
|
||||
vframes = 4
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1925188339]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.047, 0)
|
||||
shape = SubResource("CapsuleShape3D_fg04g")
|
||||
|
||||
[node name="MovementModule" type="Node" parent="." node_paths=PackedStringArray("PlayerStorage", "_inputProvider", "HitboxSpriteProvider")]
|
||||
[node name="MovementModule" type="Node" parent="." unique_id=1861634139 node_paths=PackedStringArray("_inputProvider", "HitboxSpriteProvider")]
|
||||
script = ExtResource("5_fg04g")
|
||||
PlayerStorage = NodePath("../Storage")
|
||||
_inputProvider = NodePath("../InputProvider")
|
||||
HitboxSpriteProvider = NodePath("../StrafeSpriteProvider")
|
||||
Speed = 5
|
||||
|
|
@ -300,27 +289,27 @@ Deceleration = 20.0
|
|||
Gravity = -20.0
|
||||
FallSpeed = 4.0
|
||||
|
||||
[node name="Storage" type="Node" parent="." node_paths=PackedStringArray("Root", "Shield")]
|
||||
[node name="Storage" type="Node" parent="." unique_id=1021659451 node_paths=PackedStringArray("Root", "Shield")]
|
||||
script = ExtResource("6_habpy")
|
||||
Root = NodePath("..")
|
||||
Shield = NodePath("../DamageReceiver/ShieldProvider")
|
||||
|
||||
[node name="MouseAimProvider" type="Node3D" parent="."]
|
||||
[node name="MouseAimProvider" type="Node3D" parent="." unique_id=1865779508]
|
||||
script = ExtResource("9_2ffwi")
|
||||
|
||||
[node name="InputProvider" type="Node" parent="."]
|
||||
[node name="InputProvider" type="Node" parent="." unique_id=2104117342]
|
||||
script = ExtResource("7_4cdxq")
|
||||
|
||||
[node name="InteractionController" type="Area3D" parent="."]
|
||||
[node name="InteractionController" type="Area3D" parent="." unique_id=126034338]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
script = ExtResource("10_habpy")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractionController"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractionController" unique_id=1991253142]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0410156, 0)
|
||||
shape = SubResource("CylinderShape3D_habpy")
|
||||
|
||||
[node name="ActivationProvider" type="Area3D" parent="." node_paths=PackedStringArray("_inputProvider", "_selectorController", "_errorSound")]
|
||||
[node name="ActivationProvider" type="Area3D" parent="." unique_id=976355176 node_paths=PackedStringArray("_inputProvider", "_selectorController", "_errorSound")]
|
||||
collision_layer = 0
|
||||
collision_mask = 32
|
||||
script = ExtResource("11_4exx2")
|
||||
|
|
@ -329,48 +318,47 @@ _selectorController = NodePath("SelectorController")
|
|||
_errorSound = NodePath("AudioStreamPlayer")
|
||||
SelectorScene = ExtResource("24_j6bpw")
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape3D" parent="ActivationProvider"]
|
||||
[node name="CollisionShape" type="CollisionShape3D" parent="ActivationProvider" unique_id=115835695]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.294313, 0)
|
||||
shape = SubResource("CylinderShape3D_6d8x8")
|
||||
|
||||
[node name="SelectorController" type="Node" parent="ActivationProvider"]
|
||||
[node name="SelectorController" type="Node" parent="ActivationProvider" unique_id=719847925]
|
||||
script = ExtResource("11_4cdxq")
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="ActivationProvider"]
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="ActivationProvider" unique_id=271739399]
|
||||
stream = ExtResource("13_2ffwi")
|
||||
bus = &"Effects"
|
||||
|
||||
[node name="AudioListener3D" type="AudioListener3D" parent="."]
|
||||
[node name="AudioListener3D" type="AudioListener3D" parent="." unique_id=1967851684]
|
||||
current = true
|
||||
|
||||
[node name="WeaponOffset" type="Marker3D" parent="."]
|
||||
[node name="WeaponOffset" type="Marker3D" parent="." unique_id=1832899051]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.267617, 0, -0.24769)
|
||||
|
||||
[node name="WeaponModule" type="Node" parent="." node_paths=PackedStringArray("WeaponProvider", "InputProvider", "Storage")]
|
||||
[node name="WeaponModule" type="Node" parent="." unique_id=602279131 node_paths=PackedStringArray("WeaponProvider", "InputProvider")]
|
||||
script = ExtResource("15_el8as")
|
||||
WeaponProvider = NodePath("WeaponProvider")
|
||||
InputProvider = NodePath("../InputProvider")
|
||||
Storage = NodePath("../Storage")
|
||||
|
||||
[node name="WeaponProvider" type="Node" parent="WeaponModule" node_paths=PackedStringArray("StorageModule", "WeaponRightOffset", "WeaponLeftOffset")]
|
||||
[node name="WeaponProvider" type="Node" parent="WeaponModule" unique_id=993514432 node_paths=PackedStringArray("StorageModule", "WeaponRightOffset", "WeaponLeftOffset")]
|
||||
script = ExtResource("16_olwak")
|
||||
StorageModule = NodePath("../../Storage")
|
||||
WeaponTemplate = ExtResource("17_olwak")
|
||||
WeaponRightOffset = NodePath("../../WeaponOffset")
|
||||
WeaponLeftOffset = NodePath("../../WeaponOffset")
|
||||
|
||||
[node name="AcidDeathModule" type="Node" parent="."]
|
||||
[node name="AcidDeathModule" type="Node" parent="." unique_id=289999579]
|
||||
script = ExtResource("19_7selo")
|
||||
|
||||
[node name="AcidDetector" type="Area3D" parent="."]
|
||||
[node name="AcidDetector" type="Area3D" parent="." unique_id=1725199608]
|
||||
visible = false
|
||||
collision_layer = 2
|
||||
collision_mask = 256
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="AcidDetector"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="AcidDetector" unique_id=2141311278]
|
||||
shape = SubResource("SphereShape3D_ok250")
|
||||
|
||||
[node name="DamageReceiver" type="Area3D" parent="." node_paths=PackedStringArray("_healthProvider", "_shieldProvider", "_motivationProvider")]
|
||||
[node name="DamageReceiver" type="Area3D" parent="." unique_id=1485556963 node_paths=PackedStringArray("_healthProvider", "_shieldProvider", "_motivationProvider")]
|
||||
collision_layer = 2
|
||||
collision_mask = 384
|
||||
script = ExtResource("26_ok6gd")
|
||||
|
|
@ -380,33 +368,33 @@ _motivationProvider = NodePath("MotivationProvider")
|
|||
ShieldDamageResistances = Array[ExtResource("27_5v3dv")]([SubResource("Resource_c4ide"), SubResource("Resource_fjg1v"), SubResource("Resource_hed00"), SubResource("Resource_q2flx"), SubResource("Resource_k7ckg"), SubResource("Resource_qlmfy")])
|
||||
HealthDamageResistances = Array[ExtResource("27_5v3dv")]([SubResource("Resource_v2m0j"), SubResource("Resource_awrib"), SubResource("Resource_nfrn8"), SubResource("Resource_nfq4p"), SubResource("Resource_m1iep"), SubResource("Resource_ckpe7"), SubResource("Resource_p5rkw")])
|
||||
|
||||
[node name="HealthProvider" type="Node" parent="DamageReceiver"]
|
||||
[node name="HealthProvider" type="Node" parent="DamageReceiver" unique_id=503415379]
|
||||
script = ExtResource("28_b3jpo")
|
||||
ResourceName = "Health"
|
||||
_maxResource = 32.0
|
||||
|
||||
[node name="MotivationProvider" type="Node" parent="DamageReceiver"]
|
||||
[node name="MotivationProvider" type="Node" parent="DamageReceiver" unique_id=19462968]
|
||||
script = ExtResource("28_b3jpo")
|
||||
ResourceName = "Motivation"
|
||||
_maxResource = 400.0
|
||||
|
||||
[node name="ShieldProvider" type="Node" parent="DamageReceiver"]
|
||||
[node name="ShieldProvider" type="Node" parent="DamageReceiver" unique_id=741152349]
|
||||
script = ExtResource("28_b3jpo")
|
||||
ResourceName = "Shield"
|
||||
_maxResource = 32.0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape3D" parent="DamageReceiver"]
|
||||
[node name="CollisionShape2D" type="CollisionShape3D" parent="DamageReceiver" unique_id=2054160743]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00122255, -0.00129807, 0.000553966)
|
||||
shape = SubResource("SphereShape3D_p313o")
|
||||
|
||||
[node name="StrafeSpriteProvider" type="Node3D" parent="." node_paths=PackedStringArray("Hitbox", "Circle", "Square")]
|
||||
[node name="StrafeSpriteProvider" type="Node3D" parent="." unique_id=601792497 node_paths=PackedStringArray("Hitbox", "Circle", "Square")]
|
||||
script = ExtResource("29_tmq7e")
|
||||
Hitbox = NodePath("Hitbox")
|
||||
Circle = NodePath("MagicCircle")
|
||||
Square = NodePath("MagicSquare")
|
||||
RotationSpeed = 1.0
|
||||
|
||||
[node name="MagicCircle" type="AnimatedSprite3D" parent="StrafeSpriteProvider"]
|
||||
[node name="MagicCircle" type="AnimatedSprite3D" parent="StrafeSpriteProvider" unique_id=33246122]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.2, 0)
|
||||
modulate = Color(1, 1, 1, 0.501961)
|
||||
pixel_size = 0.05
|
||||
|
|
@ -414,7 +402,7 @@ texture_filter = 0
|
|||
render_priority = -1
|
||||
sprite_frames = SubResource("SpriteFrames_h1heu")
|
||||
|
||||
[node name="MagicSquare" type="AnimatedSprite3D" parent="StrafeSpriteProvider"]
|
||||
[node name="MagicSquare" type="AnimatedSprite3D" parent="StrafeSpriteProvider" unique_id=1568764158]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.2, 0)
|
||||
modulate = Color(1, 1, 1, 0.501961)
|
||||
pixel_size = 0.05
|
||||
|
|
@ -422,7 +410,7 @@ texture_filter = 0
|
|||
render_priority = -1
|
||||
sprite_frames = SubResource("SpriteFrames_nwocn")
|
||||
|
||||
[node name="Hitbox" type="AnimatedSprite3D" parent="StrafeSpriteProvider"]
|
||||
[node name="Hitbox" type="AnimatedSprite3D" parent="StrafeSpriteProvider" unique_id=864776619]
|
||||
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
|
||||
material_overlay = SubResource("StandardMaterial3D_10kkd")
|
||||
ignore_occlusion_culling = true
|
||||
|
|
@ -432,13 +420,13 @@ texture_filter = 0
|
|||
render_priority = 1
|
||||
sprite_frames = SubResource("SpriteFrames_nk07c")
|
||||
|
||||
[node name="CrosshairModule" type="Node3D" parent="." node_paths=PackedStringArray("Storage", "AnimatedSprite")]
|
||||
[node name="CrosshairModule" type="Node3D" parent="." unique_id=1217617478 node_paths=PackedStringArray("Storage", "AnimatedSprite")]
|
||||
script = ExtResource("33_iw7um")
|
||||
Storage = NodePath("../Storage")
|
||||
AnimatedSprite = NodePath("Crosshair")
|
||||
CrosshairDistance = 2.0
|
||||
|
||||
[node name="Crosshair" type="AnimatedSprite3D" parent="CrosshairModule"]
|
||||
[node name="Crosshair" type="AnimatedSprite3D" parent="CrosshairModule" unique_id=2018331755]
|
||||
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
|
||||
pixel_size = 0.05
|
||||
no_depth_test = true
|
||||
|
|
@ -446,24 +434,24 @@ texture_filter = 0
|
|||
render_priority = 1
|
||||
sprite_frames = SubResource("SpriteFrames_gndug")
|
||||
|
||||
[node name="GrazingModule" type="Area3D" parent="." node_paths=PackedStringArray("Shield")]
|
||||
[node name="GrazingModule" type="Area3D" parent="." unique_id=1504889833 node_paths=PackedStringArray("Shield")]
|
||||
collision_layer = 0
|
||||
collision_mask = 128
|
||||
script = ExtResource("39_gndug")
|
||||
Shield = NodePath("../DamageReceiver/ShieldProvider")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="GrazingModule"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="GrazingModule" unique_id=941721476]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.12463379, 0)
|
||||
shape = SubResource("CylinderShape3D_nk07c")
|
||||
|
||||
[node name="Shadow" type="Decal" parent="."]
|
||||
[node name="Shadow" type="Decal" parent="." unique_id=453557761]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.101867676, -0.35475922, 0.10064697)
|
||||
size = Vector3(0.5, 0.74853516, 0.5)
|
||||
texture_albedo = ExtResource("41_10kkd")
|
||||
normal_fade = 0.5
|
||||
cull_mask = 1048574
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=928712549]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.7139473, 0)
|
||||
visible = false
|
||||
layers = 2
|
||||
|
|
|
|||
|
|
@ -5,14 +5,37 @@ namespace Cirno.Scripts.Components.Actors._3D;
|
|||
[Tool]
|
||||
public partial class AnimatedShaderSprite3D : AnimatedSprite3D
|
||||
{
|
||||
private bool _isConnected = false;
|
||||
private bool _isConnected;
|
||||
private ShaderMaterial _shaderMaterial;
|
||||
|
||||
// Export the shader parameter name so the shader can use a different uniform name if needed.
|
||||
[Export]
|
||||
public string ShaderParameterName { get; set; } = "tex";
|
||||
|
||||
/// <summary>
|
||||
/// Called when the node enters the scene tree. Ensure the shader receives the current
|
||||
/// sprite frame right away (avoids the garbled default until the first frame change).
|
||||
/// </summary>
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
ConnectSignals();
|
||||
_shaderMaterial = (ShaderMaterial)MaterialOverride;
|
||||
|
||||
// Safely try to use the MaterialOverride as a ShaderMaterial. If it's not present
|
||||
// we warn and skip applying parameters to avoid runtime exceptions.
|
||||
if (MaterialOverride is ShaderMaterial sm)
|
||||
{
|
||||
_shaderMaterial = sm;
|
||||
}
|
||||
else
|
||||
{
|
||||
_shaderMaterial = null;
|
||||
GD.PrintErr($"AnimatedShaderSprite3D: MaterialOverride is not a ShaderMaterial on '{Name}'. Shader parameters will not be applied.");
|
||||
}
|
||||
|
||||
// Defer applying the current frame until after the engine finishes initialization
|
||||
// so we avoid reading frames or materials before they're fully ready.
|
||||
CallDeferred(nameof(ApplyCurrentFrame));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -29,7 +52,42 @@ public partial class AnimatedShaderSprite3D : AnimatedSprite3D
|
|||
|
||||
protected void HandleFrameChanged()
|
||||
{
|
||||
_shaderMaterial.SetShaderParameter("tex", SpriteFrames.GetFrameTexture(Animation, Frame));
|
||||
ApplyCurrentFrame();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Safely set the shader parameter to the current animation/frame texture.
|
||||
/// This method protects against missing SpriteFrames, missing animation names,
|
||||
/// and null material so it won't crash at startup.
|
||||
/// </summary>
|
||||
private void ApplyCurrentFrame()
|
||||
{
|
||||
if (_shaderMaterial is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var frames = SpriteFrames;
|
||||
if (frames is null)
|
||||
{
|
||||
// No frames assigned; nothing to do.
|
||||
return;
|
||||
}
|
||||
|
||||
// Guard against missing animation or frame out-of-range.
|
||||
try
|
||||
{
|
||||
var tex = frames.GetFrameTexture(Animation, Frame);
|
||||
if (tex is not null)
|
||||
{
|
||||
_shaderMaterial.SetShaderParameter(ShaderParameterName, tex);
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
// Don't crash the editor/runtime for a missing animation name or bad frame index.
|
||||
GD.PrintErr($"AnimatedShaderSprite3D: Could not apply frame texture on '{Name}': {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue