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

前面分析选择类时,还有一个功能,就是把选中物品的状态和生命值显示出来。

它是通过下面的函数实现

protected override IEnumerable<IRenderable> RenderSelectionBars(Actor self, WorldRenderer wr, bool displayHealth, bool displayExtra)

这个函数后面有两个参数displayHealth判断是否显示生命值,displayExtra是判断是否显示额外状态。

{

    // Do

发表回复

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