本文整理汇总了C#中OpenRA.Graphics.Animation.PlayRepeating方法的典型用法代码示例。如果您正苦于以下问题:C# Animation.PlayRepeating方法的具体用法?C# Animation.PlayRepeating怎么用?C# Animation.PlayRepeating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenRA.Graphics.Animation
的用法示例。
在下文中一共展示了Animation.PlayRepeating方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GravityBomb
public GravityBomb(GravityBombInfo info, ProjectileArgs args)
{
Args = args;
altitude = args.srcAltitude;
anim = new Animation(info.Image);
if (anim.HasSequence("open"))
anim.PlayThen("open", () => anim.PlayRepeating("idle"));
else
anim.PlayRepeating("idle");
}
示例2: GravityBomb
public GravityBomb(GravityBombInfo info, ProjectileArgs args)
{
this.info = info;
this.args = args;
pos = args.Source;
velocity = new WVec(WRange.Zero, WRange.Zero, -info.Velocity);
anim = new Animation(info.Image);
if (anim.HasSequence("open"))
anim.PlayThen("open", () => anim.PlayRepeating("idle"));
else
anim.PlayRepeating("idle");
}
示例3: Bullet
public Bullet(BulletInfo info, ProjectileArgs args)
{
Info = info;
Args = args;
if (info.Inaccuracy > 0)
{
var factor = ((Args.dest - Args.src).ToCVec().Length) / args.weapon.Range;
Args.dest += (PVecInt) (info.Inaccuracy * factor * args.firedBy.World.SharedRandom.Gauss2D(2)).ToInt2();
Log.Write("debug", "Bullet with Inaccuracy; factor: #{0}; Projectile dest: {1}", factor, Args.dest);
}
if (Info.Image != null)
{
anim = new Animation(Info.Image, GetEffectiveFacing);
anim.PlayRepeating("idle");
}
if (Info.ContrailLength > 0)
{
Trail = new ContrailHistory(Info.ContrailLength,
Info.ContrailUsePlayerColor ? ContrailHistory.ChooseColor(args.firedBy) : Info.ContrailColor,
Info.ContrailDelay);
}
}
示例4: Missile
public Missile(MissileInfo info, ProjectileArgs args)
{
this.info = info;
this.args = args;
pos = args.Source;
facing = args.Facing;
targetPosition = args.PassiveTarget;
// Convert ProjectileArg definitions to world coordinates
// TODO: Change the yaml definitions so we don't need this
var inaccuracy = (int)(info.Inaccuracy * 1024 / Game.CellSize);
speed = info.Speed * 1024 / (5 * Game.CellSize);
if (info.Inaccuracy > 0)
offset = WVec.FromPDF(args.SourceActor.World.SharedRandom, 2) * inaccuracy / 1024;
if (info.Image != null)
{
anim = new Animation(info.Image, () => facing);
anim.PlayRepeating("idle");
}
if (info.ContrailLength > 0)
{
var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor;
trail = new ContrailRenderable(args.SourceActor.World, color, info.ContrailLength, info.ContrailDelay, 0);
}
}
示例5: Missile
public Missile(MissileInfo info, ProjectileArgs args)
{
this.info = info;
this.args = args;
pos = args.Source;
facing = args.Facing;
targetPosition = args.PassiveTarget;
var world = args.SourceActor.World;
if (world.SharedRandom.Next(100) <= info.LockOnProbability)
lockOn = true;
if (info.Inaccuracy.Range > 0)
{
var inaccuracy = OpenRA.Traits.Util.ApplyPercentageModifiers(info.Inaccuracy.Range, args.InaccuracyModifiers);
offset = WVec.FromPDF(world.SharedRandom, 2) * inaccuracy / 1024;
}
if (info.Image != null)
{
anim = new Animation(world, info.Image, () => facing);
anim.PlayRepeating("idle");
}
if (info.ContrailLength > 0)
{
var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor;
trail = new ContrailRenderable(world, color, info.ContrailLength, info.ContrailDelay, 0);
}
}
示例6: NukeLaunch
public NukeLaunch(Player firedBy, string weapon, WPos launchPos, WPos targetPos, WDist velocity, int delay, bool skipAscent, string flashType)
{
this.firedBy = firedBy;
this.weapon = weapon;
this.delay = delay;
this.turn = delay / 2;
this.flashType = flashType;
var offset = new WVec(WDist.Zero, WDist.Zero, velocity * turn);
ascendSource = launchPos;
ascendTarget = launchPos + offset;
descendSource = targetPos + offset;
descendTarget = targetPos;
anim = new Animation(firedBy.World, weapon);
anim.PlayRepeating("up");
pos = launchPos;
var weaponRules = firedBy.World.Map.Rules.Weapons[weapon.ToLowerInvariant()];
if (weaponRules.Report != null && weaponRules.Report.Any())
Sound.Play(weaponRules.Report.Random(firedBy.World.SharedRandom), pos);
if (skipAscent)
ticks = turn;
}
示例7: NukeLaunch
public NukeLaunch(Player firedBy, string name, WeaponInfo weapon, string weaponPalette, string upSequence, string downSequence,
WPos launchPos, WPos targetPos, WDist velocity, int delay, bool skipAscent, string flashType)
{
this.firedBy = firedBy;
this.weapon = weapon;
this.weaponPalette = weaponPalette;
this.downSequence = downSequence;
this.delay = delay;
turn = delay / 2;
this.flashType = flashType;
var offset = new WVec(WDist.Zero, WDist.Zero, velocity * turn);
ascendSource = launchPos;
ascendTarget = launchPos + offset;
descendSource = targetPos + offset;
descendTarget = targetPos;
anim = new Animation(firedBy.World, name);
anim.PlayRepeating(upSequence);
pos = launchPos;
if (weapon.Report != null && weapon.Report.Any())
Game.Sound.Play(weapon.Report.Random(firedBy.World.SharedRandom), pos);
if (skipAscent)
ticks = turn;
}
示例8: WithFire
public WithFire(Actor self)
{
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 RenderSimple.AnimationWithOffset( roof, () => new float2(7,-15), null ) { ZOffset = 24 } );
}
示例9: Parachute
public Parachute(Actor cargo, WPos dropPosition)
{
this.cargo = cargo;
parachutableInfo = cargo.Info.Traits.GetOrDefault<ParachutableInfo>();
if (parachutableInfo != null)
fallVector = new WVec(0, 0, parachutableInfo.FallRate);
var parachuteSprite = parachutableInfo != null ? parachutableInfo.ParachuteSequence : null;
if (parachuteSprite != null)
{
parachute = new Animation(cargo.World, parachuteSprite);
parachute.PlayThen("open", () => parachute.PlayRepeating("idle"));
}
var shadowSprite = parachutableInfo != null ? parachutableInfo.ShadowSequence : null;
if (shadowSprite != null)
{
shadow = new Animation(cargo.World, shadowSprite);
shadow.PlayRepeating("idle");
}
if (parachutableInfo != null)
parachuteOffset = parachutableInfo.ParachuteOffset;
// Adjust x,y to match the target subcell
cargo.Trait<IPositionable>().SetPosition(cargo, cargo.World.Map.CellContaining(dropPosition));
var cp = cargo.CenterPosition;
pos = new WPos(cp.X, cp.Y, dropPosition.Z);
}
示例10: Missile
public Missile(MissileInfo info, ProjectileArgs args)
{
Info = info;
Args = args;
SubPxPosition = 1024 * Args.src;
Altitude = Args.srcAltitude;
Facing = Args.facing;
if (info.Inaccuracy > 0)
offset = (info.Inaccuracy * args.firedBy.World.SharedRandom.Gauss2D(2)).ToInt2();
if (Info.Image != null)
{
anim = new Animation(Info.Image, () => Facing);
anim.PlayRepeating("idle");
}
if (Info.ContrailLength > 0)
{
Trail = new ContrailHistory(Info.ContrailLength,
Info.ContrailUsePlayerColor ? ContrailHistory.ChooseColor(args.firedBy) : Info.ContrailColor,
Info.ContrailDelay);
}
}
示例11: Missile
public Missile(MissileInfo info, ProjectileArgs args)
{
this.info = info;
this.args = args;
pos = args.Source;
facing = args.Facing;
targetPosition = args.PassiveTarget;
if (info.Inaccuracy.Range > 0)
offset = WVec.FromPDF(args.SourceActor.World.SharedRandom, 2) * info.Inaccuracy.Range / 1024;
if (info.Image != null)
{
anim = new Animation(args.SourceActor.World, info.Image, () => facing);
anim.PlayRepeating("idle");
}
if (info.ContrailLength > 0)
{
var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor;
trail = new ContrailRenderable(args.SourceActor.World, color, info.ContrailLength, info.ContrailDelay, 0);
}
}
示例12: GpsSatellite
public GpsSatellite(World world, WPos pos)
{
this.pos = pos;
anim = new Animation(world, "sputnik");
anim.PlayRepeating("idle");
}
示例13: PowerdownIndicator
public PowerdownIndicator(Actor a)
{
this.a = a;
anim = new Animation(a.World, "poweroff");
anim.PlayRepeating("offline");
}
示例14: PowerdownIndicator
public PowerdownIndicator(Actor a)
{
this.a = a;
canPowerDown = a.Trait<CanPowerDown>();
anim = new Animation(a.World, canPowerDown.Info.IndicatorImage);
anim.PlayRepeating(canPowerDown.Info.IndicatorSequence);
}
示例15: NukeLaunch
public NukeLaunch(Actor silo, string weapon, int2 targetLocation)
{
this.silo = silo;
this.targetLocation = targetLocation;
anim = new Animation("nuke");
anim.PlayRepeating("up");
pos = silo.CenterLocation;
}