Add-on that simplifies the usage of Google's Material Symbols (previously known as Material Icons) on Unity. The motivation is to have a lightweight set of uniform icons in order to provide the same design throughout the application UI, improving UX.
Recommended Unity versions are 2022 or higher.
Supported Unity versions are 2017 or higher.
Initial Forked Version - v226.0.0
Based on the original project by Convalise
URL: https://github.com/convalise/unity-material-symbols
This forked version introduces two significant updates, organized into two branches:
feature | See changes |
---|---|
no-feature | See changes |
In most cases you'll be better off with the no-feature branch as this reflects what the original repo does.
- Hit
(+)
and selectAdd package from Git URL(Unity 2019.4+)
- For the
feature
branch, paste thegit URL
: https://github.com/ebukaracer/UnityMaterialSymbols.git#feature - For the
no-feature
branch, do the same using: https://github.com/ebukaracer/UnityMaterialSymbols.git#no-feature - Hit
Add
- If you're using assembly definition in your project, ensure to add this package's reference:
Convalise.MaterialSymbols
, under Assembly Definition References
Note: Both branches cannot be installed simultaneously, as one will override the other.
Simply add the MaterialSymbol
component to your UI GameObject and you are good to go.
Alternatively, a new object can be added to the scene by right-clicking on the hierarchy window and selecting UI > Google > Material Symbol
.
The inspector provides a window to easily select between the available symbols or icons.
The MaterialSymbol
class inherits from UnityEngine.UI.Text
, so it has all properties and methods available here such as color
and raycast target
.
Each icon is composed by a pair of a unicode-escaped char and a Boolean representing the glyph code and the fill status respectively.
The icon can be set programmatically by setting the Symbol
field with a new MaterialSymbolData
object:
public class Demo : MonoBehaviour
{
private MaterialSymbol _materialSymbol;
private void Start()
{
_materialSymbol.Symbol = new MaterialSymbolData('\uEF55', false);
}
}
It can also be set directly by setting the Code
and Fill
properties:
_materialSymbol.Code = '\uEF55';
_materialSymbol.Fill = false;
Additionally, a serialized MaterialSymbolData
field can be used to bring the Symbol
inspector on any class:
public class Demo : MonoBehaviour
{
private MaterialSymbol _materialSymbol;
[SerializeField]
private MaterialSymbolData symbolData;
private void Start()
{
_materialSymbol.Symbol = symbolData;
_materialSymbol.color = Color.blue;
}
}
This project was created by Conrado (https://github.com/convalise) as an improvement of the deprecated Unity Material Icons.
It makes usage of the Material Design icons by Google (Material Symbols).
More information on the Google's project can be found at the Material Symbols Guide.
See FAQs