private static TileSheet LoadTileSheetFromNode(XmlNode _node, SceneBase scene, SceneItem item) { if (_node.Attributes.GetNamedItem("tileSheetSource") != null && _node.Attributes.GetNamedItem("tileSheetRef") != null) { String tileScope = _node.Attributes["tileSheetSource"].InnerText; String tileRef = _node.Attributes["tileSheetRef"].InnerText; TileSheet returnTilesheet = null; if (tileScope.ToUpper() == "LOCAL") { returnTilesheet = scene.GetTileSheet(tileRef); } else if (tileScope.ToUpper() == "GLOBAL") { returnTilesheet = SceneManager.GlobalDataHolder.GetTileSheet(tileRef); } if (returnTilesheet != null) { return returnTilesheet; } else { throw new Exception("The SceneItem \"" + item.Name + "\" is trying to use an invalid TileSheet: [" + tileScope.ToUpper() + "] \"" + tileRef + "\""); } } else { return null; } }