ajout des graines procédurales et des cinamatiques
This commit is contained in:
@@ -9,6 +9,11 @@ const PARTICLES_SCENE : PackedScene = preload("res://common/vfx/particles/effect
|
||||
signal harvest_animation_finished
|
||||
|
||||
var last_updated_on_state : PlantData.State = PlantData.State.MATURE
|
||||
var stored_seed_image : Texture = null
|
||||
|
||||
func setup_plant_sprite(plant_data : PlantData):
|
||||
%PlantedSeed.texture = PlantTextureBuilder.build_seed_texture(plant_data.plant_name.hash())
|
||||
update_plant_sprite(plant_data,true)
|
||||
|
||||
func update_plant_sprite(plant_data : PlantData, with_animation = false):
|
||||
if with_animation:
|
||||
@@ -17,8 +22,7 @@ func update_plant_sprite(plant_data : PlantData, with_animation = false):
|
||||
|
||||
%Sprite.flip_h = true if plant_data.random_seed%2 == 0 else false
|
||||
%Sprite.texture = PlantTextureBuilder.build_plant_texture(plant_data)
|
||||
|
||||
%PlantedSeed.texture = PlantTextureBuilder.build_seed_texture(plant_data.random_seed)
|
||||
|
||||
%PlantedSeed.visible = plant_data.get_state() == PlantData.State.PLANTED
|
||||
|
||||
# %PlantedSeed.region_rect = Rect2(
|
||||
|
||||
Reference in New Issue
Block a user