decal
@ -0,0 +1,23 @@
|
||||
[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://dkxgra6y2u30l"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/normal_hit.tres" id="1_h0ykq"]
|
||||
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="2_mje6b"]
|
||||
[ext_resource type="Animation" uid="uid://dxgqn5fa7aokj" path="res://resource/skill_animation/hero01_fist_air_skill01.tres" id="3_q461t"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="4_seudu"]
|
||||
[ext_resource type="Resource" uid="uid://c6alg8pmqfdxm" path="res://config/weapon/fist.tres" id="5_70pp4"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_mje6b")
|
||||
weapon = ExtResource("5_70pp4")
|
||||
stance_from = 10
|
||||
stance_to = 0
|
||||
break_level = 3
|
||||
action = "attack_heavy"
|
||||
name = ""
|
||||
skill_animation = ExtResource("3_q461t")
|
||||
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_h0ykq")])
|
||||
sub_character_list = Array[Resource("res://script/config/character_cfg.gd")]([])
|
||||
free_lock = false
|
||||
refresh_animation = false
|
||||
sprite_frames = ExtResource("4_seudu")
|
||||
animation_name = "fist_air_skill01"
|
||||
@ -0,0 +1,18 @@
|
||||
from PIL import Image
|
||||
|
||||
# Open the image
|
||||
image = Image.open('decal_shockwave.png')
|
||||
|
||||
# Get the image size
|
||||
width, height = image.size
|
||||
|
||||
# Modify each pixel's RGBA value
|
||||
for x in range(width):
|
||||
for y in range(height):
|
||||
r, g, b, a = image.getpixel((x, y))
|
||||
# Modify the RGBA values here
|
||||
# For example, invert the colors
|
||||
image.putpixel((x, y), (255,255,255,r))
|
||||
|
||||
# Save the modified image
|
||||
image.save('decal_shockwave.png')
|
||||
|
After Width: | Height: | Size: 7.5 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://brgii0qi4s6kb"
|
||||
path="res://.godot/imported/decal_dust.png-018d105ab63df278ad4deeb5e793a989.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://render/texture/shape/decal_dust.png"
|
||||
dest_files=["res://.godot/imported/decal_dust.png-018d105ab63df278ad4deeb5e793a989.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=0
|
||||
compress/normal_map=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b6bfacouwy2hi"
|
||||
path="res://.godot/imported/decal_glow.png-60e7c65c14d9ba83f9accaada44f46cd.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://render/texture/shape/decal_glow.png"
|
||||
dest_files=["res://.godot/imported/decal_glow.png-60e7c65c14d9ba83f9accaada44f46cd.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=0
|
||||
compress/normal_map=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
|
After Width: | Height: | Size: 51 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dkhmqgtc8tn1t"
|
||||
path="res://.godot/imported/decal_shockwave.png-ff3f5745d48dd37c112ee6075801a729.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://render/texture/shape/decal_shockwave.png"
|
||||
dest_files=["res://.godot/imported/decal_shockwave.png-ff3f5745d48dd37c112ee6075801a729.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=0
|
||||
compress/normal_map=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 7.7 KiB |
@ -0,0 +1,122 @@
|
||||
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://dxgqn5fa7aokj"]
|
||||
|
||||
[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="1_0ac7k"]
|
||||
|
||||
[resource]
|
||||
resource_name = "hero01_fist_air_skill01"
|
||||
length = 0.9
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("View:sprite_frames")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("1_0ac7k")]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("View:animation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": ["fist_air_skill01"]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("View:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Status:break_level")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.8),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [0, 3, 4]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("Status:speed_up_rate")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0.3, 0.7),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [-0.5, -1.0]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("Status:skill_move_speed")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0.2, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [5.0, 0.0]
|
||||
}
|
||||
tracks/6/type = "method"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("Battle")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0.6),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"attack"
|
||||
}]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("Status:skill_float_speed")
|
||||
tracks/7/interp = 1
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0.2, 0.2001, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [-4.0, -4.0, 0.0]
|
||||
}
|
||||
tracks/8/type = "method"
|
||||
tracks/8/imported = false
|
||||
tracks/8/enabled = true
|
||||
tracks/8/path = NodePath("Effect")
|
||||
tracks/8/interp = 1
|
||||
tracks/8/loop_wrap = true
|
||||
tracks/8/keys = {
|
||||
"times": PackedFloat32Array(0.2, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"cast_attack_particle"
|
||||
}, {
|
||||
"args": [],
|
||||
"method": &"cast_attack_particle"
|
||||
}]
|
||||
}
|
||||
@ -1,10 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b12fa5bpdmhms"]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b12fa5bpdmhms"]
|
||||
|
||||
[ext_resource type="SpriteFrames" uid="uid://cwe8setoi6bd" path="res://resource/animation/character/hero01_move.aseprite" id="1_1twno"]
|
||||
[ext_resource type="Script" path="res://script/effect/afterimage.gd" id="2_grtq1"]
|
||||
|
||||
[node name="AfterImage" type="AnimatedSprite3D"]
|
||||
pixel_size = 0.02
|
||||
sprite_frames = ExtResource("1_1twno")
|
||||
animation = &"idle_loop"
|
||||
[node name="AfterImage" type="Node3D"]
|
||||
script = ExtResource("2_grtq1")
|
||||
life_time = 0.2
|
||||
|
||||
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."]
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dfdt6u2dbig3e"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://me2heq5v1c5q" path="res://scene/effect/particle/particle_dash_normal.tscn" id="1_1r02f"]
|
||||
|
||||
[node name="Particle" instance=ExtResource("1_1r02f")]
|
||||
@ -0,0 +1,5 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://ds7mp5l20ypb6"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://5d1a3s6x77wd" path="res://scene/effect/particle/particle_decal_normal.tscn" id="1_tw6qm"]
|
||||
|
||||
[node name="Particle" instance=ExtResource("1_tw6qm")]
|
||||
@ -0,0 +1,41 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://me2heq5v1c5q"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_5usbn"]
|
||||
[ext_resource type="Material" uid="uid://dtyosukxpf33d" path="res://render/material/effect_slash.tres" id="2_w7v70"]
|
||||
[ext_resource type="Material" uid="uid://dubkkji6sm8on" path="res://render/process_material/slash_normal.tres" id="3_uy3s2"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://dq207a0waxk0j" path="res://render/mesh/slash1.obj" id="4_1ed4g"]
|
||||
[ext_resource type="Material" uid="uid://bkbuvtya3uk3x" path="res://render/material/effect_skew1.tres" id="5_uwxv5"]
|
||||
|
||||
[node name="Particle" type="Node3D"]
|
||||
script = ExtResource("1_5usbn")
|
||||
|
||||
[node name="Slash" type="GPUParticles3D" parent="."]
|
||||
layers = 512
|
||||
material_override = ExtResource("2_w7v70")
|
||||
cast_shadow = 0
|
||||
gi_mode = 0
|
||||
emitting = false
|
||||
amount = 1
|
||||
lifetime = 0.25
|
||||
one_shot = true
|
||||
speed_scale = 1.5
|
||||
fixed_fps = 60
|
||||
local_coords = true
|
||||
process_material = ExtResource("3_uy3s2")
|
||||
draw_pass_1 = ExtResource("4_1ed4g")
|
||||
|
||||
[node name="Skew1" type="GPUParticles3D" parent="."]
|
||||
transform = Transform3D(0.99, 0, 0, 0, 0.99, 0, 0, 0, 0.99, 0, 0, 0)
|
||||
layers = 512
|
||||
material_override = ExtResource("5_uwxv5")
|
||||
cast_shadow = 0
|
||||
gi_mode = 0
|
||||
emitting = false
|
||||
amount = 1
|
||||
lifetime = 0.25
|
||||
one_shot = true
|
||||
speed_scale = 1.5
|
||||
fixed_fps = 60
|
||||
local_coords = true
|
||||
process_material = ExtResource("3_uy3s2")
|
||||
draw_pass_1 = ExtResource("4_1ed4g")
|
||||
@ -0,0 +1,65 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://5d1a3s6x77wd"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_2t2j1"]
|
||||
[ext_resource type="Texture2D" uid="uid://bjv7f83tdgq17" path="res://render/texture/shape/decal_explode.png" id="2_vkpca"]
|
||||
[ext_resource type="Script" path="res://script/effect/particle_decal.gd" id="3_dwi0o"]
|
||||
[ext_resource type="Texture2D" uid="uid://brgii0qi4s6kb" path="res://render/texture/shape/decal_dust.png" id="4_jxr0h"]
|
||||
[ext_resource type="Texture2D" uid="uid://dkhmqgtc8tn1t" path="res://render/texture/shape/decal_shockwave.png" id="5_c3jkk"]
|
||||
[ext_resource type="Texture2D" uid="uid://b6bfacouwy2hi" path="res://render/texture/shape/decal_glow.png" id="6_2la8o"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_w5jkx"]
|
||||
max_value = 0.6
|
||||
_data = [Vector2(0, 0), 0.0, 0.84, 0, 0, Vector2(0.0196078, 0.6), 0.0, 0.0, 0, 0, Vector2(1, 0.6), 0.0, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
|
||||
[sub_resource type="Curve" id="Curve_r6bwy"]
|
||||
max_value = 1.5
|
||||
_data = [Vector2(0, 1.06915), 0.0, 1.4, 0, 0, Vector2(1, 1.5), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="Curve" id="Curve_18e7g"]
|
||||
min_value = 1.0
|
||||
max_value = 2.0
|
||||
_data = [Vector2(0, 1), 0.0, 1.4, 0, 0, Vector2(1, 2), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[node name="Particle" type="Node3D"]
|
||||
script = ExtResource("1_2t2j1")
|
||||
|
||||
[node name="DecalExplode" type="Decal" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
|
||||
size = Vector3(1, 5, 1)
|
||||
texture_albedo = ExtResource("2_vkpca")
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
cull_mask = 1
|
||||
script = ExtResource("3_dwi0o")
|
||||
lifetime = 3.0
|
||||
scale_curve = SubResource("Curve_w5jkx")
|
||||
|
||||
[node name="DecalDust" type="Decal" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
|
||||
size = Vector3(1, 5, 1)
|
||||
texture_albedo = ExtResource("4_jxr0h")
|
||||
cull_mask = 1
|
||||
script = ExtResource("3_dwi0o")
|
||||
lifetime = 0.5
|
||||
scale_curve = SubResource("Curve_r6bwy")
|
||||
rotate = 15
|
||||
|
||||
[node name="DecalShockwave" type="Decal" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
|
||||
size = Vector3(1, 5, 1)
|
||||
texture_albedo = ExtResource("5_c3jkk")
|
||||
cull_mask = 1
|
||||
script = ExtResource("3_dwi0o")
|
||||
lifetime = 0.1
|
||||
scale_curve = SubResource("Curve_18e7g")
|
||||
|
||||
[node name="DecalGlow" type="Decal" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
|
||||
size = Vector3(1, 5, 1)
|
||||
texture_albedo = ExtResource("6_2la8o")
|
||||
cull_mask = 1
|
||||
script = ExtResource("3_dwi0o")
|
||||
lifetime = 0.1
|
||||
scale_curve = SubResource("Curve_18e7g")
|
||||
@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cxj65e7teugyw"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bd7kst3jrrma5" path="res://render/texture/shape/readiness_bullet.png" id="1_qpapc"]
|
||||
[ext_resource type="Texture2D" uid="uid://bd7kst3jrrma5" path="res://render/texture/shape/readiness_bullet.png" id="1_30j48"]
|
||||
|
||||
[node name="ReadinessHero" type="Decal"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
|
||||
size = Vector3(1, 1, 1)
|
||||
texture_albedo = ExtResource("1_qpapc")
|
||||
texture_albedo = ExtResource("1_30j48")
|
||||
cull_mask = 1
|
||||
@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://7ej8d4b1lc0v"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dpsxejelj58f8" path="res://render/texture/shape/readiness_hero.png" id="1_gkbai"]
|
||||
[ext_resource type="Texture2D" uid="uid://dpsxejelj58f8" path="res://render/texture/shape/readiness_hero.png" id="1_msawg"]
|
||||
|
||||
[node name="ReadinessHero" type="Decal"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
|
||||
size = Vector3(1, 1, 1)
|
||||
texture_albedo = ExtResource("1_gkbai")
|
||||
texture_albedo = ExtResource("1_msawg")
|
||||
cull_mask = 1
|
||||
@ -1,22 +1,20 @@
|
||||
extends AnimatedSprite3D
|
||||
extends EffectBase
|
||||
class_name Afterimage
|
||||
|
||||
@export var duration_max:float = 0.2
|
||||
@export var is_moving:bool = true
|
||||
@export var is_moving : bool = true
|
||||
@onready var image = $AnimatedSprite3D as AnimatedSprite3D
|
||||
var velocity : Vector3
|
||||
var target : AnimatedSprite3D
|
||||
|
||||
var duration:float
|
||||
var velocity:Vector3
|
||||
|
||||
func _ready():
|
||||
duration = duration_max
|
||||
|
||||
func _process(delta):
|
||||
func on_ready():
|
||||
image.sprite_frames = target.sprite_frames
|
||||
image.animation = target.animation
|
||||
image.frame = target.frame
|
||||
image.frame_progress = target.frame_progress
|
||||
image.scale.x = target.scale.x
|
||||
image.pixel_size = Setting.pixel_size
|
||||
|
||||
func on_process(delta):
|
||||
if is_moving:
|
||||
position += velocity*delta
|
||||
|
||||
var rate = duration / duration_max
|
||||
modulate.a = rate
|
||||
|
||||
duration-=delta
|
||||
if duration<=0:
|
||||
queue_free()
|
||||
image.modulate.a = rate
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
extends Node3D
|
||||
class_name EffectBase
|
||||
|
||||
@export var life_time : float = 1
|
||||
var life_time_now : float
|
||||
var is_pause : bool = false
|
||||
var rate : float
|
||||
|
||||
func _ready():
|
||||
life_time_now = life_time
|
||||
on_ready()
|
||||
|
||||
func _process(delta):
|
||||
if is_pause:
|
||||
return
|
||||
life_time_now -= delta
|
||||
if life_time_now <= 0:
|
||||
queue_free()
|
||||
return
|
||||
rate = life_time_now / life_time
|
||||
on_process(delta)
|
||||
|
||||
func set_pause(is_pause_set:bool):
|
||||
is_pause = is_pause_set
|
||||
on_set_pause(is_pause_set)
|
||||
|
||||
func on_ready():pass
|
||||
func on_process(delta:float):pass
|
||||
func on_set_pause(is_pause_set:bool):pass
|
||||
@ -0,0 +1,30 @@
|
||||
extends Decal
|
||||
class_name ParticleDecal
|
||||
|
||||
@export var lifetime : float = 1
|
||||
@export var gradient : Gradient
|
||||
@export var scale_curve : Curve
|
||||
@export var rotate : int
|
||||
|
||||
var lifetime_now : float
|
||||
|
||||
func on_process(delta:float):
|
||||
lifetime_now += delta
|
||||
var rate = lifetime_now / lifetime
|
||||
if rate > 1:
|
||||
return
|
||||
|
||||
#色带
|
||||
if gradient:
|
||||
modulate = gradient.sample(rate)
|
||||
else:
|
||||
modulate.a = 1 - rate
|
||||
|
||||
#缩放曲线
|
||||
if scale_curve:
|
||||
var scale_sample = scale_curve.sample(rate)
|
||||
scale = Vector3(scale_sample,1,scale_sample)
|
||||
|
||||
#旋转
|
||||
rotation_degrees.y = rotate * rate
|
||||
|
||||