I've managed to create the field type like below.
Code: Select all
[CustomFieldTypeService.Name("Reward")]
public class RewardField : CustomFieldType
{
public RewardPack rewardPack;
public override string Draw(string currentValue, DialogueDatabase dataBase)
{
throw new System.NotImplementedException();
}
public virtual object Draw()
{
return EditorGUILayout.ObjectField(rewardPack, typeof(RewardPack), true);
}
}
All of the fields seem to be string based. I'm wondering if there is some way that I could tie it to objects instead. So I could assign the reward in the editor via the Scriptable Object, and then retrieve it from the quest log when I need to. But I haven't figured out a way to do this yet.
I followed the example in this how-to post to get this far: https://www.pixelcrushers.com/phpbb/vie ... +to+fields
I was thinking that maybe there was some way to do a call a little like this:
Code: Select all
var rewards = DialogueLua.GetQuestField("Quest 1", "Reward Pack");