So I am coding a dialogue system and everything is going perfectly fine until Unity said error void doesn’t work. So I tried all of this other stuff and I can’t seem to fix it. Can someone please help!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DialogueSystem : MonoBehaviour {
public static DialogueSystem Instance { get; set; }
public List<string> dialogueLines = new List<string>();
void Awake () {
if (Instance != null && Instance != this)
{
Destroy(gameObject);
}
else
{
Instance = this;
}
}
}
public void AddNewDialogue(string[] lines)
{
dialogueLines = new List<string>();
foreach(string line in lines)
{
dialogueLines.Add(line);
}
Debug.Log(dialogueLines.Count);
}
}