本文整理汇总了C#中Material.LoadAreasDefinition方法的典型用法代码示例。如果您正苦于以下问题:C# Material.LoadAreasDefinition方法的具体用法?C# Material.LoadAreasDefinition怎么用?C# Material.LoadAreasDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Material
的用法示例。
在下文中一共展示了Material.LoadAreasDefinition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAssets
private static void LoadAssets(XmlDocument doc, SceneBase scene)
{
string _lastValidName = "";
try
{
XmlNode _el = doc.SelectSingleNode("IceScene/Assets");
int _count = _el.ChildNodes.Count;
int _current = 0;
foreach (XmlNode _node in _el.ChildNodes)
{
_current++;
int perc = (int)((double)_current / (double)_count * 100); ;
FireStatusUpdate(string.Format("Loading Asset {0}/{1}", _current, _count), perc);
IceAsset asset = null;
if (_node.Name.ToUpper() == "MATERIAL")
{
Material newMat = new Material();
asset = newMat;
scene.Materials.Add(newMat);
TraceLogger.TraceInfo("Loading Material");
if (_node.Attributes.GetNamedItem("areas_definition") != null)
{
newMat.AreasDefinitionFilename
= _node.Attributes["areas_definition"].InnerText;
String definitionPath = Path.Combine(SceneSerializer.RootPath, newMat.AreasDefinitionFilename);
TraceLogger.TraceVerbose("Loading AreasDefinitionFilename: " + newMat.AreasDefinitionFilename);
newMat.LoadAreasDefinition(definitionPath);
}
}
else if (_node.Name.ToUpper() == "FONT")
{
asset = new IceFont();
scene.Fonts.Add(asset as IceFont);
TraceLogger.TraceInfo("Loading Font");
}
else if (_node.Name.ToUpper() == "EFFECT")
{
#if !XNATOUCH
asset = CreateEffectInstance(_node.Attributes["type"].InnerText);
scene.Effects.Add(asset as IceEffect);
TraceLogger.TraceInfo("Loading Effect");
#endif
}
else if (_node.Name.ToUpper() == "TILESHEET")
{
TileSheet newTileSheet = LoadTileSheet(_node, scene);
asset = newTileSheet;
scene.TileSheets.Add(newTileSheet);
TraceLogger.TraceInfo("Loading TileSheet");
}
asset.Scope = AssetScope.Local;
if (scene == SceneManager.GlobalDataHolder)
{
asset.Scope = AssetScope.Global;
}
asset.Parent = scene;
asset.Name = _node.Attributes["name"].InnerText;
_lastValidName = asset.Name;
if (_node.Attributes.GetNamedItem("location") != null)
{
asset.Filename = _node.Attributes["location"].InnerText;
}
else
{
asset.Filename = "";
}
TraceLogger.TraceInfo("Name : " + asset.Name);
TraceLogger.TraceVerbose("FileName : " + asset.Filename);
TraceLogger.TraceVerbose("Scope : " + asset.Scope.ToString());
}
}
catch (Exception err)
{
if (err != null)
{
#if(WINDOWS)
Trace.TraceError("ERROR In Load Assets - " + _lastValidName);
#endif
throw new ArgumentException("Error in load materials: " + err.Message);
}
}
}