Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add HeaderImage attribute. #165

Closed
wants to merge 11 commits into from

Conversation

shanecelis
Copy link

Hi Denis,

Here is my patch to add a HeaderImage attribute. It's based on the ShowAssetPreview code. It works like this:

public class _NaughtyComponent : MonoBehaviour
{
  public const string ICON
    = "Assets/NaughtyAttributes/Samples/DemoScene/TestAssets/quadratic.png";
  [HeaderImage(ICON)]
  public float a;

  [HeaderImage(ICON, Height = 96, Alignment = EAlignment.Center)]
  public float b;

  [HeaderImage(ICON, Width = 96, Alignment = EAlignment.Right)]
  public float c;
}

inspector

The README has been updated with essentially what's shown above.

I have tried to follow suit with the existing code base. If I have violated on any conventions, I apologize and am happy to see them corrected.

Thank you for the excellent NaughtyAttributes project. I hope this is helpful.

-Shane
twitter: @shanecelis

@dbrizov
Copy link
Owner

dbrizov commented Sep 11, 2021

This is for the older version. I created a request, and will implement it when I can. #271

@dbrizov dbrizov closed this Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants