Skip to content

Commit 5911bf3

Browse files
committed
Allow checking uniform values
1 parent 51c41c0 commit 5911bf3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/GateEngine/Types/Material.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ public struct Material {
2828
return customUniformValues.sorted(by: { $0.key.compare($1.key) == .orderedAscending })
2929
}
3030
public mutating func setCustomUniformValue(
31-
_ value: any CustomUniformType,
31+
_ value: (any CustomUniformType)?,
3232
forUniform name: String
3333
) {
3434
customUniformValues[name] = value
3535
}
3636

37+
public func hasCustomUniformValue(named key: String) -> Bool {
38+
return customUniformValues.keys.contains(key)
39+
}
40+
3741
@usableFromInline
3842
internal var channels: [Channel] = [Channel(color: .defaultDiffuseMapColor)]
3943
@discardableResult

0 commit comments

Comments
 (0)