|
1 | | -# Unity-NumberCounter |
2 | | -Simple Number Counter Shader for Unity |
| 1 | +## Unity Number Counter Shader |
| 2 | + |
| 3 | +This document is also available in other languages: |
| 4 | +[[English]](./README.md) [[한국어]](./README.ko.md) [[日本語]](README.ja.md) |
| 5 | + |
| 6 | +[![GitHub Release][shields-release]][github-release] |
| 7 | + |
| 8 | +[shields-release]: https://img.shields.io/github/v/release/hisacat/Unity-NumberCounterShader |
| 9 | +[github-release]: https://github.com/hisacat/Unity-NumberCounterShader/releases/latest |
| 10 | + |
| 11 | +This is a simple shader for displaying numbers in Unity. |
| 12 | + |
| 13 | +- Displays up to 6 digits |
| 14 | +- Lightweight shader with optimized performance |
| 15 | +- Fully compatible with `Particle System` |
| 16 | +- Comes with 7 default font textures |
| 17 | + |
| 18 | +There’s no requirement to credit this project, though it is appreciated! |
| 19 | +If you enjoy my project, please consider **supporting me** through the button below <3 |
| 20 | + |
| 21 | +<a href="https://www.buymeacoffee.com/HisaCat"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me Milk&emoji=🥛&slug=HisaCat&button_colour=bd5fff&font_colour=ffffff&font_family=Bree&outline_colour=000000&coffee_colour=ffffff" /></a> |
| 22 | + |
| 23 | +## Font Texture Example |
| 24 | + |
| 25 | +Below is an example of a font texture. (The actual background should be transparent.) |
| 26 | + |
| 27 | +You can create and use custom font textures as well. A [Font Template.psd](./Assets/HisaCat/Number Counter/FontTemplate.psd) file is provided to help you get started. |
| 28 | + |
| 29 | +## Usage |
| 30 | + |
| 31 | +- Refer to the [`HisaCat/Number Counter/Sample Scene`](./Assets/HisaCat/Number Counter/Samples/Sample Scene.unity) for examples. |
| 32 | + To use, simply apply materials with shaders like `HisaCat/Number Counter Unlit Cutout` or `HisaCat/Number Counter Unlit Alpha Blended` to a Quad or Mesh. |
| 33 | +- Properties: |
| 34 | +  |
| 35 | + - `Color`: The final color to be multiplied. |
| 36 | + - `Sprite Sheet`: A texture containing digits 0–9 (5 Columns 2 Rows). |
| 37 | + - `Display Length`: Number of digits to display. |
| 38 | + - `Value`: The value to display. |
| 39 | + - `Align`: Alignment of the displayed value. |
| 40 | + - `Fill Zeros`: Right-align with empty spaces filled with `0`. |
| 41 | + - `Left`: Left-aligns the number. |
| 42 | + - `Right`: Right-aligns the number. |
| 43 | + |
| 44 | +## Additional Information |
| 45 | + |
| 46 | +This shader is manually coded and optimized for performance. |
| 47 | +The core logic is located in [Number Counter.cginc](./Assets/HisaCat/Number Counter/Shaders/Number Counter.cginc) if you’re interested in exploring the code. |
| 48 | + |
| 49 | +Since this shader excludes certain padding areas around the edges, enabling the texture’s `Mipmaps` option won’t cause visual artifacts, which makes it compatible with games like VRChat. |
| 50 | +If you encounter any issues, please let me know through the [Issue](https://github.com/hisacat/Unity-NumberCounterShader/issues) tab! |
| 51 | + |
| 52 | +## LICENSE |
| 53 | + |
| 54 | +This project is completely open-source, allowing anyone to freely use, modify, and distribute it under the condition that the copyright information is included in all copies. The software is provided “as is,” with no liability held by the author for any issues or damages resulting from its use. |
| 55 | + |
| 56 | +For details, please refer to the [License](./LICENSE). |
0 commit comments