-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
[Question] How to change how ShowNonSerializedFields are rendered #378
Comments
This at this point is not possible, because NA will always render A workaround is to write a extended script. This is what i use in my project: Delete all non-functional (because I have many other drawer extension as well). This works on my project but because the extensions not included here, and many custom functions I used for myself, so not guaranteed it works in yours. But... you get the idea. And add a Update: and this is how it looks like in my project. Note the button is in the middle of where it should be. [SerializeField, Ordered] private int _pIntPrivateOrdered;
[Ordered]
public int pIntOrdered;
[Button("Button Text"), Ordered]
private void MethodTwo() { }
[ShowNativeProperty, Ordered] private string NativeString => "NativeString";
[ShowNonSerializedField, Ordered] private const int NonSerInt = 9;
[Ordered]
public Animator someAnimator;
[AnimatorParam(nameof(someAnimator)), Ordered]
public int paramHash; Update: @AndrzejKebab I just notice that the sort function is incorrect... Please change _fieldWithInfos.Sort((a, b) =>
{
// Debug.Assert(a.inherentDepth != 0);
// Debug.Assert(b.inherentDepth != 0);
int firstResult = a.inherentDepth.CompareTo(b.inherentDepth);
return firstResult != 0
? firstResult
: a.order.CompareTo(b.order);
}); Into: _fieldWithInfos = _fieldWithInfos
.WithIndex()
.OrderBy(each => each.value.inherentDepth)
.ThenBy(each => each.value.order)
.ThenBy(each => each.index)
.Select(each => each.value)
.ToArray(); I have also updated the gist script. (P.S. I've open-sourced my utils from my old project and published here, if you're interested please consider to have a look. The gist is basiclly this script) |
So I'm doing a RPG game and i have bunch of stats and i would like to have the non serialized values to show at their places in inspector
The text was updated successfully, but these errors were encountered: