khanat-assets---3d-godot-cl.../meshes/props/travel_box/container.gd

21 lines
811 B
GDScript

tool
extends Spatial
export( Color ) var color = Color( 1.0, 1.0, 1.0, 1.0 ) setget set_color
func set_color( value ):
color = value
$container_bottom/container_bottom.get_surface_material( 0 ).albedo_color = self.color
$container_lid/container_lid.get_surface_material( 0 ).albedo_color = self.color
export( Color ) var color2 = Color( 1.0, 1.0, 1.0, 1.0 ) setget set_color2
func set_color2( value ):
color2 = value
$container_bottom/container_bottom.get_surface_material( 1 ).albedo_color = self.color2
$container_lid/container_lid.get_surface_material( 1 ).albedo_color = self.color2
export( float ) var lid_angle = 0.0 setget set_lid_angle
func set_lid_angle( value ):
if value < 0.0 or value > 100.0:
return
lid_angle = value
$container_lid.rotation_degrees = Vector3( -lid_angle, 0.0, 0.0 )