grunk/src/world/surface_material.gd

22 lines
459 B
GDScript3
Raw Normal View History

2025-03-31 19:04:37 -06:00
class_name SurfaceMaterial
enum Type {
UNKNOWN,
GRUNK,
PLASTIC,
METAL,
}
const METAL_MATERIAL_GROUP := "MetalMaterial"
const PLASTIC_MATERIAL_GROUP := "PlasticMaterial"
static func material_for_collider(collider: Node) -> SurfaceMaterial.Type:
if collider is GunkNode:
return Type.GRUNK
if collider.is_in_group(METAL_MATERIAL_GROUP):
return Type.METAL
if collider.is_in_group(PLASTIC_MATERIAL_GROUP):
return Type.PLASTIC
return Type.UNKNOWN