Pass WorldRenderer to AnimationWithOffset.OffsetFunc.
This commit is contained in:
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc
|
||||
: 0);
|
||||
|
||||
var offset = new float2(-32,-21);
|
||||
anims.Add("lights", new AnimationWithOffset( lights, () => offset, () => !buildComplete )
|
||||
anims.Add("lights", new AnimationWithOffset( lights, wr => offset, () => !buildComplete )
|
||||
{ ZOffset = 24 });
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
|
||||
var wake = new Animation(anim.Name);
|
||||
wake.Play("left-wake");
|
||||
Func<float2> offset = () => new float2(((anims["wake"].Animation.CurrentSequence.Name == "left-wake") ? 1 : -1),2);
|
||||
Func<WorldRenderer, float2> offset = wr => new float2(((anims["wake"].Animation.CurrentSequence.Name == "left-wake") ? 1 : -1),2);
|
||||
anims.Add( "wake", new AnimationWithOffset( wake, offset, () => false ) { ZOffset = -2 } );
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Cnc
|
||||
var rs = self.Trait<RenderSimple>();
|
||||
var roof = new Animation(rs.GetImage(self));
|
||||
roof.PlayThen("fire-start", () => roof.PlayRepeating("fire-loop"));
|
||||
rs.anims.Add( "fire", new AnimationWithOffset( roof, () => new float2(7,-15), null ) { ZOffset = 24 } );
|
||||
rs.anims.Add( "fire", new AnimationWithOffset( roof, wr => new float2(7,-15), null ) { ZOffset = 24 } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user