Skip to content

This project simplifies the usage of Google's Material Symbols (Icons) on Unity.

License

Notifications You must be signed in to change notification settings

ebukaracer/UnityMaterialSymbols

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Material Symbols (Icons) for Unity

PRs Welcome

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.

Samples Gallery

gif1

gif2

Changes

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.

Installation

Note: Both branches cannot be installed simultaneously, as one will override the other.

Quick Usage

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;
	}
}

Credits

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

About

This project simplifies the usage of Google's Material Symbols (Icons) on Unity.

Resources

License

Stars

Watchers

Forks

Packages

No packages published