-
-
Notifications
You must be signed in to change notification settings - Fork 471
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
TypeDropdown Attribute #354
Comments
Quck Note: |
I am really interested in this ! |
What do you think? Should I submit a pull request with a preprocessor directive hiding it from older versions of unity? |
Hey! What's the progress on this? |
I am about to merge a lot of pull requests next weekend, so I will include it :) |
Formerly Created a PR here: |
Does it include? I did not find it in the master branch. |
@HaikunHuang This PR has been pending for quite a while, and NaughtyAttributes has not been maintained for years. I'd like to suggest SaintsField which:
using SaintsField;
[Serializable]
public class Base1Fruit
{
public GameObject base1;
}
[Serializable]
public class Base2Fruit: Base1Fruit
{
public int base2;
}
[SerializeReference, ReferencePicker]
public Base2Fruit item;
public interface IRefInterface
{
public int TheInt { get; }
}
// Omitted other inherent...
[SerializeReference, ReferencePicker]
public IRefInterface myInterface; It also support field grouping: using SaintsField;
public interface IRefInterface
{
public int TheInt { get; }
}
[Serializable]
public struct StructImpl : IRefInterface
{
[field: SerializeField]
public int TheInt { get; set; }
[LayoutStart("Hi", ELayout.FoldoutBox)]
public string myStruct;
public ClassDirect nestedClass;
}
[SerializeReference, ReferencePicker, SaintsRow]
public IRefInterface saints;
[SerializeReference, ReferencePicker(hideLabel: true), SaintsRow(inline: true)]
public IRefInterface inline; |
Thanks, Tyler. This is very cool! |
I've written this attribute using the SerializedReference API. It should work with pretty much any Non UnityEngine.Object derived type. Here is an example of it in action. I would submit a pull request for it, but it requires the project to be upgraded to 2021.2.
I could use a preprocessor directive to hide it, after I make my pull request. What are your thoughts?
The text was updated successfully, but these errors were encountered: