Page 2 of 2

Re: How To: Add Custom Fields

Posted: Sun May 10, 2020 2:52 pm
by davidisak
Yep, it's in the same Editor folder as the CustomFieldType_TemplateType.cs. I can see that none of the overriden draw functions seems to be called.

Re: How To: Add Custom Fields

Posted: Sun May 10, 2020 3:18 pm
by Tony Li
Does the MissionType example work correctly? If you have copied it, perhaps your copy is conflicting with the original one. I just tested the MissionType example with Unity 2019.3 and the eval version of DS 2.2.6, and it seems to work correctly.

Re: How To: Add Custom Fields

Posted: Sun May 10, 2020 3:28 pm
by davidisak
hmm okey, the mission type example is not working correctly for me. It appears as a type that I can choose correctly but I don't get any dropdown to select from in the value as shown in the previous image.
So my process is:
I create a script called CustomFieldType_MissionType.cs in the same folder as the CustomFieldType_TemplateType.cs and then I just remove the Unity default code in it and paste in your example code.
I will poke around some more and see if I can figure out what's wrong. One thing I noticed is that the MissionType appears in the top and not in the bottom of the types as shown in your initial post if that helps anything. Attached image of it.

Image

Re: How To: Add Custom Fields

Posted: Sun May 10, 2020 3:52 pm
by Tony Li
It's OK that Mission Type appears at the top of the dropdown.

Here's a unitypackage with the custom Mission Type if you'd like to give it a try:

DS_CustomFieldType_2020-04-01.unitypackage

Re: How To: Add Custom Fields

Posted: Sun May 10, 2020 3:55 pm
by davidisak
I just found the problem now! I put the script under an Editor folder under Assets/ now instead and not at the same place as the template and that solved it. My bad! Thought it had to be in an Editor folder somwhere under the Plugin folder.

Re: How To: Add Custom Fields

Posted: Sun May 10, 2020 3:56 pm
by davidisak
Thanks a lot for the super quick response and help. Big 5 star there from me on the asset store! :)

Re: How To: Add Custom Fields

Posted: Sun May 10, 2020 4:05 pm
by Tony Li
Glad to help! :-)