Hello,
I'm getting compiler errors on a script moving from Visual Studio Code to Unity & am wondering if this is a Unity issue or Playmaker related. Here is the message:
Assets/Scripts/XMLManager.cs(19,27): error CS0116: A namespace cannot directly contain members such as fields or methods
Am I missing something? Here's the script it's complaining about:
using UnityEngine;
using System.Collections;
using System.Collections.Generic; //lets us use lists
using System.Xml; //basic xml attributes
using System.Xml.Serialization; //access xmlserializer
using System.IO; //file management
public class XMLManager : MonoBehaviour {
// terrible singleton pattern
public static XMLManager ins;
void Awake(){
ins = this;
}
}
//list of items
internal ItemDatabase ItemDB;
[System.Serializable]
public class ItemEntry {
public string word;
public string partofspeech;
public int value;
}
[System.Serializable]
public class ItemDatabase {
public List<ItemEntry> list = new List<ItemEntry>();
}
public enum partofspeech {
Noun,
Propernoun,
Adjective,
Adverb,
Verb,
Number,
Phrase
}