13 lines
353 B
GDScript
13 lines
353 B
GDScript
class_name EjectionSnapshot
|
|
extends RefCounted
|
|
|
|
var held_seconds: float
|
|
var required_seconds: float
|
|
var ratio: float
|
|
|
|
|
|
func _init(p_held_seconds: float, p_required_seconds: float) -> void:
|
|
held_seconds = p_held_seconds
|
|
required_seconds = p_required_seconds
|
|
ratio = clampf(held_seconds / required_seconds, 0.0, 1.0) if required_seconds > 0.0 else 0.0
|