Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何为 a 的颜色变化设置动画SCNNode?在SpriteKit我只会使用colorizeWithColor SKAction,但这不是SceneKit. 在SpriteKit中,我通常会在两个节点之间发生冲突。当节点发生碰撞时,其中一个节点只需运行colorizeWithColor SKAction. 这相当于SceneKit什么SCNNode?
SCNNode
SpriteKit
colorizeWithColor SKAction
SceneKit
您可以使用 multiply材质的属性来实现类似的效果。SCNTransaction您可以使用'animationDuration属性设置渐变长度。
multiply
SCNTransaction
animationDuration
SCNTransaction.begin() SCNTransaction.animationDuration = yourFadeDuration geometry?.firstMaterial?.multiply.contents = yourDesiredColor SCNTransaction.commit()