作者:小爬虫 | 来源:互联网 | 2023-09-05 17:04
InGameplayKit,IwanttoconformtheprotocolGKAgentDelegate,henceusethedelegatemethodfunca
In GameplayKit, I want to conform the protocol GKAgentDelegate, hence use the delegate method func agentDidUpdate(agent: GKAgent)
.
在GameplayKit中,我希望遵守协议GKAgentDelegate,因此使用委托方法func agentDidUpdate(agent: GKAgent)。
The problem is, in this method, the parameter agent is declared as GKAgent, not GKAgent2D, so that I cannot access agent.position
, because the position property is in GKAgent2D, not GKAgent...
问题是,在这个方法中,参数代理被声明为GKAgent,而不是GKAgent2D,因此我无法访问代理。位置,因为位置属性在GKAgent2D中,而不是GKAgent…
However in Objective-C API, agent is declared as GKAgent2D.
但是在Objective-C API中,代理被声明为GKAgent2D。
Please help.
请帮助。
1 个解决方案