ARCore 是否具有 ARKit 的 "guard let planeAnchor" 语义等价物?
Does ARCore have a semantic equivalent of ARKit's "guard let planeAnchor"?
我想知道ARCore
/Kotlin
中是否有类似ARKit
/Swift
中的guard let
语句的语义结构?
let anchor: ARAnchor?
guard let planeAnchor = anchor as? ARPlaneAnchor else {
print("condition not met")
return
}
我想我已经找到了 ARCore 的 planeAnchor
与 Elvis 运算符 和 safe cast 运算符 所需的语义:
public class CenterPosePlaneAnchor { ... }
val anchor: Anchor?
val info = "condition not met"
val planeAnchor = anchor as? CenterPosePlaneAnchor ?: return println(info)
我想知道ARCore
/Kotlin
中是否有类似ARKit
/Swift
中的guard let
语句的语义结构?
let anchor: ARAnchor?
guard let planeAnchor = anchor as? ARPlaneAnchor else {
print("condition not met")
return
}
我想我已经找到了 ARCore 的 planeAnchor
与 Elvis 运算符 和 safe cast 运算符 所需的语义:
public class CenterPosePlaneAnchor { ... }
val anchor: Anchor?
val info = "condition not met"
val planeAnchor = anchor as? CenterPosePlaneAnchor ?: return println(info)