Skip to content

Conversation

JiaChen-Zeng
Copy link

@JiaChen-Zeng JiaChen-Zeng commented Jan 3, 2022

Tested on WebGL and Windows build. Both are working properly.

https://imgur.com/a/ATjwzvZ
https://drive.google.com/file/d/1ufoGV9TQzfnOK93pPi4ujVC8HG5ceZi8/view?usp=sharing (Seems imgur can't handle this video well)

I made a workaround for the WebGL build. The custom shader can't render properly so I decided to use normal GameObjects for displaying.

I added the PoolFallback class to hook into the Pool class to make GameObjects for the projectiles when needed. Then update the appearance in ProjectileManager.UpdateBuffers. I used a normal SpriteRenderer for rendering and the sprite is got from the Texture of ProjectilePrefab. To load the default sprite when the texture is empty, I moved the sprites to Resources folder. Also, I added a flag called FallbackRendering into ProjectileManager for enabling this fallback rendering.

I made sure outline prefabs will work properly as possible by setting a ceiled sortingOrder according to ZIndez. However, the data type isn't the same so there will be cases that don't work. If the ZIndez of two objects is 0.1 and 0.2, the sortingOrder for both of them will be ceiled to 1, causing the wrong order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant