Field custom drawers

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
markov
Posts: 7
Joined: Tue Feb 17, 2015 9:30 pm

Field custom drawers

Post by markov »

Hello.

I added small, but very useful feature to the system.

Now you can define custom drawers for field type.

For example:







I changed few lines in source code, so now there's interface to add your own drawer to field type:

public enum SceneType {

MainMenu,

Fight,

Map

}



[CustomFieldTypeService.Name("Scene Type")]

public class CustomFieldType_SceneType : CustomFieldType {

public override string Draw (string currentValue, DialogueDatabase dataBase) {

if (currentValue == string.Empty)

currentValue = SceneType.MainMenu.ToString();

SceneType enumValue = (SceneType) Enum.Parse(typeof(SceneType), currentValue, true);

return EditorGUILayout.EnumPopup(enumValue).ToString();

}

}







Hope this feature will be useful not only for us and dialogue system developers will add it someday.

I attached all needed files below, so you can use it as reference.
User avatar
Tony Li
Posts: 21049
Joined: Thu Jul 18, 2013 1:27 pm

Field custom drawers

Post by Tony Li »

Hi,



Thank you for sharing this! The forum software doesn't allow certain upload types. I'll try to change that tomorrow. Would you mind emailing the unitypackage file to me at tony (at) pixelcrushers.com?



Thanks!



Tony
markov
Posts: 7
Joined: Tue Feb 17, 2015 9:30 pm

Field custom drawers

Post by markov »

Okay, already did.
Post Reply