Skip to content

Latest commit

 

History

History
66 lines (55 loc) · 2.23 KB

README.md

File metadata and controls

66 lines (55 loc) · 2.23 KB

Icon Manager

GitHub package.json version GitHub issues GitHub pull requests GitHub license GitHub last commit

Icon Manager is a small utility that allows you to set icons on GameObjects through code.

Usage

Here's how you use the IconManager

private void Foo()
{
    GameObject gameObject = FetchGameObject();
    IconManager.SetIcon(gameObject, LabelIcon.Teal);
}

Or by using an extension for GameObjects

private void Foo()
{
    GameObject gameObject = FetchGameObject();
    gameObject.SetIcon(ShapeIcon.CircleGreen);
}

Removing an icon is also possible; both through the IconManager and via an extension method

private void Foo()
{
    GameObject gameObject = FetchGameObject();

    IconManager.RemoveIcon(gameObject);
    // or
    gameObject.RemoveIcon();
}

Contributing

Pull requests are welcomed. Please feel free to fix any issues you find, or add new features.

Installing

Installing Icon Manager into your Unity3D project is done through the Package Manager.

You can either add the package manually to the manifest.json file:

{
    "dependencies": {
        "net.tnrd.constrainedrect": "https://github.com/thundernerd/unity3d-iconmanager"
    }
}

Or add it through the UI by selecting the + button in the top left of the Package Manager, selecting Add package from git URL..., and pasting https://github.com/Thundernerd/Unity3D-IconManager.git in the input field.