Added a flag ShowShadow in WithVoxelBarrel, WithVoxelBody, WithVoxelTurret, WithVoxelUnloadBody and WithVoxelWalkerBody
This commit is contained in:
@@ -23,6 +23,9 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
public readonly string Sequence = "idle";
|
||||
|
||||
[Desc("Defines if the Voxel should have a shadow.")]
|
||||
public readonly bool ShowShadow = true;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new WithVoxelBody(init.Self, this); }
|
||||
|
||||
public IEnumerable<VoxelAnimation> RenderPreviewVoxels(
|
||||
@@ -32,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
var voxel = VoxelProvider.GetVoxel(image, "idle");
|
||||
yield return new VoxelAnimation(voxel, () => WVec.Zero,
|
||||
() => new[] { body.QuantizeOrientation(orientation(), facings) },
|
||||
() => false, () => 0);
|
||||
() => false, () => 0, ShowShadow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
var voxel = VoxelProvider.GetVoxel(rv.Image, info.Sequence);
|
||||
rv.Add(new VoxelAnimation(voxel, () => WVec.Zero,
|
||||
() => new[] { body.QuantizeOrientation(self, self.Orientation) },
|
||||
() => IsTraitDisabled, () => 0));
|
||||
() => IsTraitDisabled, () => 0, info.ShowShadow));
|
||||
|
||||
// Selection size
|
||||
var rvi = self.Info.TraitInfo<RenderVoxelsInfo>();
|
||||
|
||||
Reference in New Issue
Block a user