Hi,
A small script (below) will make it a lot easier. Here's an example project that also includes the script:
PlayMakerDialogueHints_2016-10-31.unitypackage
It assumes you've imported PlayMaker's
UGUI Proxy package.
In the example, the response nodes have a custom field named "Hint". The script, which is added to the Response Button, has a method SetHintVariable that copies the Hint into a Dialogue System variable (also named "Hint"). The Response Button handles the OnPointerEnter event by calling SetHintVariable and then sending an event to a PlayMaker FSM on the Response Panel.
The PlayMaker FSM looks up the Dialogue System variable and sets the HintText UI element.
The script also has alternative method SetHintVariableToScript that you can use instead of SetHintVariable if you actually want to show the content of the Script field. But since the Script field is raw Lua code, I figure you'll probably want to use a dedicated Hint field so you can make it look exactly the way you want.
The Response Button also handles the OnPointerExit event by clearing the hint.
ResponseHintToVariable.cs
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class ResponseHintToVariable : MonoBehaviour
{
public string hintField = "Hint";
public void SetHintVariable()
{
var response = GetComponent<UnityUIResponseButton>().response;
var hint = Field.LookupValue(response.destinationEntry.fields, hintField);
DialogueLua.SetVariable("Hint", hint);
}
public void ClearHintVariable()
{
DialogueLua.SetVariable("Hint", string.Empty);
}
public void SetHintVariableToScript()
{
var response = GetComponent<UnityUIResponseButton>().response;
DialogueLua.SetVariable("Hint", response.destinationEntry.userScript);
}
}