为什么未在SKScene上应用着色器?

问题描述

根据文档,// First we create a function like this: function getHeaderTitle(route) { // In case the focused route is not found,assume it's the first screen,Screen1 in this example. return getFocusedRouteNameFromroute(route) ?? 'Screen1'; } // Then we can use it like this: function MainNavigator() { return ( <Main.Navigator> <Main.Screen options={({route}) => ({ headerTitle: getHeaderTitle(route),})} name="Tabs" component={TabNavigator} /> </Main.Navigator> ); } SKScene的子级,因此,如果不为nil,应遵循并应用shader属性

我已经成功向单个SKSprites添加一个着色器(所以我知道我的着色器代码正在工作),但是如果我将相同的着色器应用于场景,则不会发生任何事情,没有错误,没有任何问题。

我尝试在多个位置初始化着色器:

  • 在SKscene的初始化中
  • 在初始化SKscene的ControllerView中
  • 在SKscene的sceneDidLoad中 无济于事。

我有什么想念的吗?

(我正在使用https://github.com/twostraws/ShaderKit中的改编代码

6年前曾问过类似的问题(Applying a custom SKShader to SKScene that pixelates the whole rendered scene in iOS 8 SpriteKit with Swift),但将怪癖标记错误(也许在此之前从未纠正过?)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)