本文整理汇总了C#中EditorMap.DrawFilter方法的典型用法代码示例。如果您正苦于以下问题:C# EditorMap.DrawFilter方法的具体用法?C# EditorMap.DrawFilter怎么用?C# EditorMap.DrawFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EditorMap
的用法示例。
在下文中一共展示了EditorMap.DrawFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsObjectVisible
/// <summary>
/// Gets if the given object is visible according to the drawing filter currently being used.
/// Objects that are never drawn or are never filtered always return true, even if they are not actually visible.
/// </summary>
/// <param name="map">The current map.</param>
/// <param name="obj">The object to check if visible.</param>
/// <returns>True if the <paramref name="obj"/> is visible or not applicable to the map drawing filter; otherwise false.</returns>
protected virtual bool IsObjectVisible(EditorMap map, object obj)
{
var drawable = obj as IDrawable;
if (drawable == null)
return true;
if (map == null)
return true;
if (map.DrawFilter == null)
return true;
return map.DrawFilter(drawable);
}