本文整理汇总了C#中GameObjects.ArchitectureList.GetGameObject方法的典型用法代码示例。如果您正苦于以下问题:C# ArchitectureList.GetGameObject方法的具体用法?C# ArchitectureList.GetGameObject怎么用?C# ArchitectureList.GetGameObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.ArchitectureList
的用法示例。
在下文中一共展示了ArchitectureList.GetGameObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadArchitectureFromString
public void LoadArchitectureFromString(ArchitectureList archs, string data)
{
char[] separator = new char[] { ' ', '\n', '\r' };
string[] strArray = data.Split(separator, StringSplitOptions.RemoveEmptyEntries);
this.architecture = new ArchitectureList();
foreach (string i in strArray)
{
this.architecture.Add(archs.GetGameObject(int.Parse(i)) as Architecture);
}
}
示例2: LoadArchitecturesFromString
public void LoadArchitecturesFromString(ArchitectureList architectures, string dataString)
{
char[] separator = new char[] { ' ', '\n', '\r', '\t' };
string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries);
this.Architectures.Clear();
foreach (string str in strArray)
{
Architecture gameObject = architectures.GetGameObject(int.Parse(str)) as Architecture;
if (gameObject != null)
{
this.AddArchitecture(gameObject);
}
}
}
示例3: LoadArchitecturesFromString
public List<string> LoadArchitecturesFromString(ArchitectureList architectures, string dataString)
{
List<string> errorMsg = new List<string>();
char[] separator = new char[] { ' ', '\n', '\r', '\t' };
string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries);
this.Architectures.Clear();
try
{
foreach (string str in strArray)
{
Architecture gameObject = architectures.GetGameObject(int.Parse(str)) as Architecture;
if (gameObject != null)
{
this.AddArchitecture(gameObject);
}
else
{
errorMsg.Add("建筑ID" + str + "不存在");
}
}
}
catch
{
errorMsg.Add("建筑列表应为半型空格分隔的建筑ID");
}
if (this.ArchitectureCount == 0)
{
errorMsg.Add("没有建筑");
}
return errorMsg;
}