[HOWTO] How To: Integrate with Horror FPS Kit
Posted: Thu Dec 05, 2019 12:01 pm
To use the Dialogue System with Horror FPS Kit, add this script to the Dialogue Manager:
SaveDS.cs
You may want to use a Dialogue System Events component to disable the player's movement and camera control during conversations. See the second half of the Interaction Tutorial for instructions on that.
SaveDS.cs
Code: Select all
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using UnityEngine;
public class SaveDS : MonoBehaviour, ISaveable
{
public void OnLoad(JToken token)
{
string data = token["dialoguesystem"].ToObject<string>();
if (string.IsNullOrEmpty(data))
{
PixelCrushers.DialogueSystem.DialogueManager.ResetDatabase();
}
else
{
PixelCrushers.DialogueSystem.PersistentDataManager.ApplySaveData(data);
}
}
public Dictionary<string, object> OnSave()
{
return new Dictionary<string, object>()
{
{ "dialoguesystem", PixelCrushers.DialogueSystem.PersistentDataManager.GetSaveData() }
};
}
}