A Node-Based Conversation Event Creation System Using Unity-GraphView.
- You can easily create conversation events by connecting nodes.
- Event information is stored in JSON format and is dynamically loaded by attaching it to a dedicated object.
- The only code you need to implement is
event.RunEvent()
and a callback function for the ID of the ending of the conversation event!
- Download the .unitypackage file from Release and import it into your Unity project.
- Open the TalkUIGraphView tab and connect the nodes.
- Create an EventManager object.
- Attach the EventData file (JSON) you just saved to the EventManager component.
- The following code is the minimal code to start a conversation event
using TalkUI;
using UnityEngine;
using UnityEngine.Events;
public class TalkUISampleScript : MonoBehaviour
{
[SerializeField]
EventManager eventManager;
private void Start()
{
UnityEvent<int> uEventCallBack = new UnityEvent<int>();
uEventCallBack.AddListener(TestCallBack);
eventManager.RunEvent(uEventCallBack);
}
public void TestCallBack(int id)
{
Debug.Log("Ending id is " + id);
}
}
- You can also refer to
TalkUI/Scenes/SampleScene
- Loading and re-editing saved EventData
- Adjusting the position of newly created nodes