I have a question about Ink-Unity integration. On a build phase i keep getting the Assets\Scripts\DialogueManager.cs(19,29): error CS0246: The type or namespace name ‘InkFile’ could not be found (are you missing a using directive or an assembly reference?) AND Assets\Scripts\DialogueManager.cs(5,11): error CS0234: The type or namespace name ‘UnityIntegration’ does not exist in the namespace ‘Ink’ (are you missing an assembly reference?) errors.
Dialog Manager looks as follows
using Ink.Runtime;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Ink.UnityIntegration;
public class DialogueManager : MonoBehaviour
{
public TextAsset inkJSON;
public DialogueContainer[] dialogueContainers;
public Story story;
public static DialogueVariables variables;
public Text textPrefab;
public Button buttonPrefab;
[Header("Globals Ink File")]
[SerializeField] public InkFile globalsInkFile;
public int Health = 0;
public bool finished = false;
public bool reset = false;
public string CurrentText;
public Dictionary dialogueChanger = new Dictionary();
void Start()
{
story = new Story(inkJSON.text);
refreshUI();
if (variables == null)
{
variables = new DialogueVariables(globalsInkFile.filePath);
}
variables.StartListening(story);
}
void refreshUI()
{
//dialogVariables = new DialogVariables(globalsInkFile.filePath);
// Debug.Log("new outcome is " + story.variablesState["outcome"]);
eraseUI();
Text storyText = Instantiate(textPrefab) as Text;
storyText.text = loadStoryChunk();
storyText.transform.SetParent(this.transform, false);
foreach (Choice choice in story.currentChoices)
{
Button choiceButton = Instantiate(buttonPrefab) as Button;
choiceButton.transform.SetParent(this.transform, false);
Text choiceText = choiceButton.GetComponentInChildren<Text>();
choiceText.text = choice.text;
choiceButton.onClick.AddListener(delegate {
chooseStoryChoice(choice);
});
}
}
void eraseUI()
{
for (int i = 0; i < this.transform.childCount; i++)
{
Destroy(this.transform.GetChild(i).gameObject);
}
}
void chooseStoryChoice(Choice choice)
{
story.ChooseChoiceIndex(choice.index);
refreshUI();
}
// Update is called once per frame
void Update()
{
}
string loadStoryChunk()
{
string text = "";
if (story.canContinue)
{
text = story.ContinueMaximally();
CurrentText = text;
}
Debug.Log("new outcome is " + story.variablesState["outcome"]);
return text;
}