tib tree animations

This commit is contained in:
Paul Chote
2010-06-13 16:04:20 +12:00
parent c4d143b729
commit b0802466b2
3 changed files with 14 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ namespace OpenRA.Mods.RA
public readonly int Interval = 75;
public readonly string ResourceType = "Ore";
public readonly int MaxRange = 100;
public readonly int AnimationInterval = 750;
public object Create(Actor self) { return new SeedsResource(); }
}
@@ -37,6 +38,7 @@ namespace OpenRA.Mods.RA
class SeedsResource : ITick
{
int ticks;
int animationTicks;
public void Tick(Actor self)
{
@@ -64,6 +66,13 @@ namespace OpenRA.Mods.RA
ticks = info.Interval;
}
if (--animationTicks <= 0)
{
var info = self.Info.Traits.Get<SeedsResourceInfo>();
self.traits.Get<RenderBuilding>().PlayCustomAnim(self, "active");
animationTicks = info.AnimationInterval;
}
}
static IEnumerable<int2> RandomWalk(int2 p, Thirdparty.Random r)