Code: Select all
[check skill="acro" dc="10"]"Watch this back flip!"[/check ]
Code: Select all
[check skill="acro" dc="10"]"Watch this back flip!"[/check ]
Code: Select all
public override void OnConversationResponseMenu(Response[] responses)
{
for (var i = 0; i < responses.Length; i++)
{
var markupResult = Dialogue.ParseMarkup(responses[i].formattedText.text);
foreach (var markupResultAttribute in markupResult.Attributes.Where(markupResultAttribute => markupResultAttribute.Name == "check"))
{
markupResultAttribute.Properties.TryGetValue("dc", out var difficulty);
markupResultAttribute.Properties.TryGetValue("skill", out var skillName);
// SkillCheckResponse is just a simple subclass of Response with values for skill name and dc
responses[i] = new SkillCheckResponse(responses[i], skillName.StringValue, difficulty.IntegerValue);
}
}
base.OnConversationResponseMenu(responses);
}
Code: Select all
GameObject buttonGameObject = null;
buttonGameObject = responses[i] is SkillCheckResponse ? InstantiateSkillCheckButton() : InstantiateButton();