Files
OpenRA/OpenRA.Mods.Common/Traits/Render/RenderBuildingCharge.cs
Matthias Mailänder d99ae3bcb9 split render building/overlay and play sound for charge
to add the Tiberian Sun Nod Obelisk

tick slightly faster

tweak the local offsets
2015-05-09 19:56:15 +02:00

40 lines
1.1 KiB
C#

#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Used for tesla coil and obelisk.")]
public class RenderBuildingChargeInfo : RenderBuildingInfo
{
[Desc("Sequence to use for building charge animation.")]
public readonly string ChargeSequence = "active";
public override object Create(ActorInitializer init) { return new RenderBuildingCharge(init, this); }
}
public class RenderBuildingCharge : RenderBuilding, INotifyCharging
{
RenderBuildingChargeInfo info;
public RenderBuildingCharge(ActorInitializer init, RenderBuildingChargeInfo info)
: base(init, info)
{
this.info = info;
}
public void Charging(Actor self, Target target)
{
PlayCustomAnim(self, info.ChargeSequence);
}
}
}