I want to compare the colors of two model entities (spheres). How can i do it? The method i'm currently trying to apply is as follows
case let .color(controlColor) = controlMaterial.baseColor, controlColor == .green {
// Flip target sphere colour
if let targetMaterial = targetsphere.model?.materials.first as? SimpleMaterial,
case let .color(targetColor) = targetMaterial.baseColor, targetColor == .blue {
targetsphere.model?.materials = [SimpleMaterial(color: .green, isMetallic: false)] // Change to |1⟩
} else {
targetsphere.model?.materials = [SimpleMaterial(color: .blue, isMetallic: false)] // Change to |0⟩
}
}
This method (baseColor) was deprecated in swift 15.0 changes to 'color' but i cannot compare the value color to each other.👾