本文整理汇总了C#中Chapter.setTitle方法的典型用法代码示例。如果您正苦于以下问题:C# Chapter.setTitle方法的具体用法?C# Chapter.setTitle怎么用?C# Chapter.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chapter
的用法示例。
在下文中一共展示了Chapter.setTitle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public void Parse(string path)
{
XmlDocument xmld = new XmlDocument ();
string xml = "";
switch (ResourceManager.Instance.getLoadingType ()) {
case ResourceManager.LoadingType.RESOURCES_LOAD:
directory = path.Split ('/') [0] + "/";
if (path.Contains (".xml")) {
path = path.Replace (".xml", "");
}
TextAsset ta = Resources.Load (path) as TextAsset;
if (ta == null) {
Debug.Log ("Can't load Descriptor file: " + path);
return;
} else
xml = ta.text;
break;
case ResourceManager.LoadingType.SYSTEM_IO:
xml = System.IO.File.ReadAllText(path);
directory = "";
string[] parts = path.Split ('/');
for(int i = 0; i < parts.Length-1; i++)
directory += parts[i] + "/";
break;
}
xmld.LoadXml(xml);
XmlElement element = xmld.DocumentElement
,descriptor = (XmlElement) element.SelectSingleNode ("/game-descriptor")
,title = (XmlElement) descriptor.SelectSingleNode ("title")
,description = (XmlElement) descriptor.SelectSingleNode ("description")
,configuration = (XmlElement) descriptor.SelectSingleNode ("configuration")
,contents = (XmlElement) descriptor.SelectSingleNode ("contents");
if (descriptor != null) {
tmpString = descriptor.GetAttribute ("versionNumber");
if (!string.IsNullOrEmpty(tmpString))
{
adventureData.setVersionNumber (tmpString);
}
}
if (title != null) {
tmpString = title.InnerText;
if (!string.IsNullOrEmpty(tmpString))
{
adventureData.setTitle (tmpString);
}
}
if (description != null) {
tmpString = description.InnerText;
if (!string.IsNullOrEmpty(tmpString))
{
adventureData.setDescription (tmpString);
}
}
if (configuration != null)
{
tmpString = configuration.GetAttribute ("keepShowing");
if (!string.IsNullOrEmpty(tmpString))
{
adventureData.setKeepShowing (tmpString.Equals("yes"));
}
tmpString = configuration.GetAttribute ("keyboard-navigation");
if (!string.IsNullOrEmpty(tmpString))
{
adventureData.setKeyboardNavigation (tmpString.Equals("enabled"));
}
tmpString = configuration.GetAttribute ("defaultClickAction");
if (!string.IsNullOrEmpty(tmpString))
{
if(tmpString.Equals("showDetails"))
adventureData.setDeafultClickAction(DescriptorData.DefaultClickAction.SHOW_DETAILS);
else if(tmpString.Equals("showDetails"))
adventureData.setDeafultClickAction(DescriptorData.DefaultClickAction.SHOW_ACTIONS);
}
tmpString = configuration.GetAttribute ("perspective");
if (!string.IsNullOrEmpty(tmpString))
{
if(tmpString.Equals("regular"))
adventureData.setPerspective(DescriptorData.Perspective.REGULAR);
else if(tmpString.Equals("isometric"))
adventureData.setPerspective(DescriptorData.Perspective.ISOMETRIC);
}
tmpString = configuration.GetAttribute ("dragBehaviour");
if (!string.IsNullOrEmpty(tmpString))
//.........这里部分代码省略.........