So I used to be able to do the following in Unity to create my state but it seems like a lot of these methods are now gone? Any guidance on how to achieve the same?
public void GenerateEditorStateFromScenario()
{
Debug.Log("Using Pulse version " + PulseEngine.Version() + "-" + PulseEngine.Hash());
string scenarioPath = AssetDatabase.GetAssetPath(initialScenarioFile);
//The path for the data to create a state
string pulseDataPath="";
SEScenarioExec execOpts = new SEScenarioExec();
var appDirectory = new DirectoryInfo(Application.dataPath);
if (appDirectory.Exists)
{
var rootPath = appDirectory.Parent;
pulseDataPath = $"{CourseHelper.Instance.GetCaffeinePackagePath()}3RD/PulsePhysiologyEngine/Data";
}
// Set the directory where Pulse can find its data files (usally bin/install)
execOpts.SetDataRootDirectory(pulseDataPath);
// Where do you want any states created by scenarios to go?
execOpts.SetSerializationDirectory(Application.persistentDataPath + "/" +
gameObject.name + "/states/");
// Set empty CSV dir if you do not want a csv file
execOpts.SetDataRequestCSVFilename("");
//execOpts.SetDataRequestCSVFilename("");
execOpts.SetLogFilename(Application.persistentDataPath + "/" +
gameObject.name + "/scenarios/PulseScenarioRunner.log");
execOpts.SetScenarioFilename(scenarioPath);
//Modify the path to serialize
JObject scenarioJSON = JObject.Parse(initialScenarioFile.text);
string newStatePath = Application.dataPath + "/Pulse States/" + initialScenarioFile.name + "_state.json";
scenarioJSON.SelectToken("..Filename").Replace(newStatePath);
//Overwrite with new content
File.WriteAllText(scenarioPath, scenarioJSON.ToString());
PulseUnityEngine pulse = new PulseUnityEngine();
if (!pulse.ExecuteScenario(execOpts))
Debug.Log("Error running scenario");
AssetDatabase.Refresh();
initialState = AssetDatabase.LoadAssetAtPath("Assets" + "/Pulse States/" + initialScenarioFile.name + "_state.json", typeof(TextAsset)) as TextAsset;
}