move render{building,buildingturreted,unit} into mods.ra; move all render traits into mods.ra.render

This commit is contained in:
Bob
2010-07-08 17:24:12 +12:00
parent 281d013c3b
commit fb6c44bce3
34 changed files with 71 additions and 60 deletions

View File

@@ -72,6 +72,18 @@ namespace OpenRA.Traits
a.Animation.Tick();
}
protected virtual string GetPrefix(Actor self)
{
return self.GetDamageState() == DamageState.Half ? "damaged-" : "";
}
public void PlayCustomAnim(Actor self, string name)
{
if (anim.HasSequence(name))
anim.PlayThen(GetPrefix(self) + name,
() => anim.PlayRepeating(GetPrefix(self) + "idle"));
}
public class AnimationWithOffset
{
public Animation Animation;