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

Support for property drawers of non unity types? (i.e., derive from System.Object only) #16

Open
eddieparker opened this issue Oct 5, 2020 · 2 comments

Comments

@eddieparker
Copy link

I love this project - but I wish it would work for simple types that don't descend from UnityEngine.Object - i.e., just plain old classes/structs with no 'parent'.

As such I wrote a quick property drawer by hacking up some of your existing code - not sure if this is the best way to implement it, but it works:

https://gist.github.com/eddieparker/7bb1fd3b253ce039994b5d677e620978

@madsbangh
Copy link
Owner

This seems super cool! I wonder if it could be integrated somehow <3 Thanks for sharing :) I hope I will get the time to look into this soon.

@antonsem
Copy link

antonsem commented Sep 4, 2021

So does this mean I can use it in a method of a serialized non-unity class? If so how? I have list of C# objects inside a ScriptableObject. C# objects have a method. When I add the [Button] attribute to that method it doesn't work. Here is what I'm talking about:

public class MySO : ScriptableObject
{
    [Serializable]
    public class MyClass
    {
        [Button]
        public void MyMethod()
        {
            Debug.Log("Doesn't work...");
        }
    }

    [SerializeField] private MyClass[] myArray;
}

I don't see MyMethod button in the inspector...

PS: I love the project! I will include it to my tools package which I use in most of my personal projects :) thanks a lot for this!

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

No branches or pull requests

3 participants