Git Product home page Git Product logo

unity3d-iconmanager's Introduction

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.

Installation

  1. The package is available on the openupm registry. You can install it via openupm-cli.
openupm add net.tnrd.iconmanager
  1. Installing through a Unity Package created by the Package Installer Creator from Needle

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

Support

Icon Manager is a small and open-source utility that I hope helps other people. It is by no means necessary but if you feel generous you can support me by donating.

ko-fi

Contributing

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

unity3d-iconmanager's People

Contributors

thundernerd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity3d-iconmanager's Issues

Suggestion - add images in readme across all your repos

I seems you have cool repos for unity. But mostly readme files do not have any image, it's hard to understand what is repo about.
It would be great if you find time and add screenshots ot gif to explain what is repo about.
Thank you for your work.

Assign custom Textures/Sprites

It's not an issue, but more a question, I hope it's the right place for this

To assign custom textures do I have to simply make the

private static void SetIcon( GameObject gObj, Texture2D texture ) {

public?

Will the asset/gameobject keep that value?
I have a setter/getter for that that also works in the editor (I've got Icons for interactions and I want the Gizmo Icon of the gameobject to reflect that).

Do I need to mark the whole gameobject to Dirty to keep the change?

Several compile errors during Android build, need more #if EDITOR conditions

Hi,

the class works just as fine until you build, then all of the classes methods and stuff of course begin throwing errors since there are parts of the code that can't work outside the editor.

I did a quick'n'dirty fix by just throwing a few #if EDITOR clauses here and there, but you may want to have something more tidy for that for the release version :)

IconManager.SetIconForObject throws Null Ref Exception in Unity2021.2 or newer, since Unity has made this internal method public : )

As the title said, Unity has made EditorGUIUtility.SetIconForObject public since 2021.2 (I only checked their C# repository though. No guarantee if they changed this in the beginning of 2021.2 or in a later smaller version update).

Now we can just call EditorGUIUtility.SetIconForObject. You might want to make the asset compatible to newer version.
It caught me by surprise when I first updated my project to 2021.3.

And thanks a lot for this sweet little asset : ). I've used it since 2021.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.