本文介绍: 在a.Trait.RenderAnnotations(a.Actor, this)调用里,就是调用前面接口RenderAnnotations函数。DrawDecorations函数判断这个物品是否选中,如果包含选中列表中,那么就可以进行下一步动作,就是调用函数RenderSelectionBox,也就是SelectionDecorations类的函数,这个函数重写基类SelectionDecorationsBase的函数RenderSelectionBox。里调用,主要参数角色对象

C#开发的OpenRA游戏属性SelectionDecorations(12)

前面分析显示选择框的指示器类SelectionBoxAnnotationRenderable,它的作用就是画一个四个角的方角。

这个类是在属性SelectionDecorations里调用的,如下

protected override IEnumerable<IRenderable&gt; RenderSelectionBox(Actor self, WorldRenderer wr, Color color)

{

    var bounds = interactable.DecorationBounds(self, wr);

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注