本文整理匯總了C#中Sledge.Editor.Documents.Document.GetTexture方法的典型用法代碼示例。如果您正苦於以下問題:C# Document.GetTexture方法的具體用法?C# Document.GetTexture怎麽用?C# Document.GetTexture使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sledge.Editor.Documents.Document
的用法示例。
在下文中一共展示了Document.GetTexture方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UpdateDecals
private static bool UpdateDecals(Document document, MapObject mo)
{
var updatedChildren = false;
foreach (var child in mo.Children) updatedChildren |= UpdateDecals(document, child);
var e = mo as Entity;
if (e == null || !ShouldHaveDecal(e)) return updatedChildren;
var decal = e.EntityData.Properties.FirstOrDefault(x => x.Key == "texture");
var existingDecal = e.MetaData.Get<string>(DecalNameMetaKey);
if (decal == null || String.Equals(decal.Value, existingDecal, StringComparison.InvariantCultureIgnoreCase)) return updatedChildren;
e.SetDecal(document.GetTexture(decal.Value.ToLowerInvariant()));
return true;
}
示例2: UpdateDecals
private static void UpdateDecals(Document document, MapObject mo)
{
mo.Children.ForEach(x => UpdateDecals(document, x));
var e = mo as Entity;
if (e == null || !ShouldHaveDecal(e)) return;
var tex = e.EntityData.Properties.FirstOrDefault(x => x.Key == "texture");
if (tex == null || (HasDecal(e) && string.Equals(GetDecal(e).Name, tex.Value, StringComparison.CurrentCultureIgnoreCase))) return;
e.SetDecal(document.GetTexture(tex.Value.ToLowerInvariant()));
}