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

Inspector element order is unpredictable with PropertyGroups #80

Open
Petethegoat opened this issue Mar 26, 2024 · 0 comments
Open

Inspector element order is unpredictable with PropertyGroups #80

Petethegoat opened this issue Mar 26, 2024 · 0 comments

Comments

@Petethegoat
Copy link

Petethegoat commented Mar 26, 2024

Expanded test case below. Turning methods into buttons does not always place them last in the inspector.

image

I did some quick experiments, and inverting the order in OrderByAttributeThenByMemberType() does make the buttons show up first even when group attributes are involved.

using UnityEngine;
using Alchemy.Inspector;

public class Oops : MonoBehaviour
{
	[SerializeField] string[] goodStrings = { "foo", "bar" };
	[SerializeField, TabGroup("Bad Zone")] string[] badStrings = { "boo", "far" };
	[SerializeField, TabGroup("Another Tab"), ListViewSettings(ShowFoldoutHeader = false)] string[] fineStrings = { "fixed by removing the foldout with ListViewSettings", "goo", "tar" };
	[SerializeField, FoldoutGroup("Foldouts are okay")] string[] goodStrings2 = { "foo", "bar" };
	[SerializeField] string test;

	[Button]
	void reticulateSplines() {
		Debug.Log("Reticulating splines...");
	}

	[Button(useParameters: false)]
	void PerformAction(string paramToIgnore, int number = 100) {
		Debug.Log($"Count: {number}");
	}

	[Button]
	void MoreMethod(int numberOfFoos = 50) {

		Debug.Log($"FooAmount: {numberOfFoos}");
	}
}
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

No branches or pull requests

1 participant