Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Matthew Reilly on May 16, 2019, 04:46:01 AM
-
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
}
-
Hi.
I wrapped your code so it is easier to read.
From what i understand there is an issue with this : internal ItemDatabase ItemDB;
But this has nothing to do with PlayMaker.
It is probably from another asset (maybe some inventory asset?)