#90 V2 animations
This commit is contained in:
@@ -158,6 +158,7 @@
|
||||
<Compile Include="Traits\RenderSimple.cs" />
|
||||
<Compile Include="Traits\RenderUnit.cs" />
|
||||
<Compile Include="Traits\RenderUnitMuzzleFlash.cs" />
|
||||
<Compile Include="Traits\RenderUnitReload.cs" />
|
||||
<Compile Include="Traits\RenderUnitRotor.cs" />
|
||||
<Compile Include="Traits\RenderUnitSpinner.cs" />
|
||||
<Compile Include="Traits\RenderUnitTurreted.cs" />
|
||||
|
||||
@@ -19,6 +19,11 @@ namespace OpenRa.Game.Traits
|
||||
return target != null;
|
||||
}
|
||||
|
||||
public bool IsReloading()
|
||||
{
|
||||
return (primaryFireDelay > 0) || (secondaryFireDelay > 0);
|
||||
}
|
||||
|
||||
public virtual void Tick(Actor self)
|
||||
{
|
||||
if (primaryFireDelay > 0) --primaryFireDelay;
|
||||
|
||||
21
OpenRa.Game/Traits/RenderUnitReload.cs
Normal file
21
OpenRa.Game/Traits/RenderUnitReload.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class RenderUnitReload : RenderUnit
|
||||
{
|
||||
public RenderUnitReload(Actor self)
|
||||
: base(self) { }
|
||||
|
||||
public override void Tick(Actor self)
|
||||
{
|
||||
base.Tick(self);
|
||||
var attack = self.traits.WithInterface<AttackBase>().FirstOrDefault();
|
||||
if (attack != null)
|
||||
anim.ReplaceAnim(attack.IsReloading() ? "empty-idle" : "idle");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user