Skip to content

Inspector element order is unpredictable with PropertyGroups #80

Open

Description

@Petethegoat

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

Activity

  1. nnra6864 commented on Apr 26, 2025

    @nnra6864
    Contributor

    I think this is related to the issue I just created, #112
    I am really enjoying this asset but this is quite a major letdown tbh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions