Procedural Circular Health Bar是一款分段圆形血量条的第三方package
有段时间可以免费录取,商品链接如下
Procedural Circular Health Bar | GUI 工具 | Unity Asset Store
该资源附带一个易于使用的脚本,可以添加到任何附加了Spriterender或Image组件的游戏对象中。
使用的时候发现在附加到有UGUI的Image组件的物体上时,在Scene窗口能正确显示,但是在Game窗口不能正确显示
经过邮件咨询作者后,对方回复说是可能是由于Shader Graph中的一个bug造成的,该bug使得材质“Sprite Unlight”和“Unlight”似乎共享了部分设置(Graph Settings)。解决方案如下
Step 1: Open the shader graph. UltimateCircularHealthBar > ShaderGraphs > RadialBarShader
This step comes with a significant load time! This is because shader graph has a hard time dealing with larger graphs.
Step 2: Open the graph inspector if it isn't already open
Step 3: Enable "Alpha Clipping" in the "Universal" section of the Graph Inspector in the "Graph Settings" tab
Step 4: Switch Material to "Sprite Unlit".
Step 5: save asset and finish.
上述步骤完成后,能正确显示