本文整理汇总了C#中TexImage.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# TexImage.GetType方法的具体用法?C# TexImage.GetType怎么用?C# TexImage.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TexImage
的用法示例。
在下文中一共展示了TexImage.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(TexImage image, IRequest request)
{
if (image.GetType() != typeof(TexAtlas))
{
throw new TextureToolsException("The given texture must be an instance of TexAtlas.");
}
TexAtlas atlas = (TexAtlas)image;
switch (request.Type)
{
case RequestType.AtlasCreation:
Create(atlas, (AtlasCreationRequest)request, 0);
break;
case RequestType.AtlasExtraction:
Extract(atlas, (AtlasExtractionRequest)request);
break;
case RequestType.AtlasUpdate:
Update(atlas, (AtlasUpdateRequest)request);
break;
default:
Log.Error("AtlasTexLibrary can't handle this request: " + request.Type);
throw new TextureToolsException("AtlasTexLibrary can't handle this request: " + request.Type);
}
}
示例2: CanHandleRequest
public bool CanHandleRequest(TexImage image, IRequest request)
{
if (image.GetType() != typeof(TexAtlas))
{
return false;
}
switch (request.Type)
{
case RequestType.AtlasCreation:
case RequestType.AtlasExtraction:
case RequestType.AtlasUpdate:
return true;
default:
return false;
}
}