本文整理匯總了C#中OpenRA.Graphics.Animation.Tick方法的典型用法代碼示例。如果您正苦於以下問題:C# Animation.Tick方法的具體用法?C# Animation.Tick怎麽用?C# Animation.Tick使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenRA.Graphics.Animation
的用法示例。
在下文中一共展示了Animation.Tick方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawControlGroup
void DrawControlGroup(WorldRenderer wr, Actor self, float2 basePosition)
{
var group = self.World.Selection.GetControlGroupForActor(self);
if (group == null) return;
var pipImages = new Animation("pips");
pipImages.PlayFetchIndex("groups", () => (int)group);
pipImages.Tick();
pipImages.Image.DrawAt(basePosition + new float2(-8, 1), wr.Palette("chrome"));
}
示例2: DrawControlGroup
void DrawControlGroup(WorldRenderer wr, Actor self, int2 basePosition)
{
var group = self.World.Selection.GetControlGroupForActor(self);
if (group == null) return;
var pipImages = new Animation("pips");
pipImages.PlayFetchIndex("groups", () => (int)group);
pipImages.Tick();
var pos = wr.Viewport.WorldToViewPx(basePosition) - (0.5f * pipImages.Image.size).ToInt2() + new int2(9, 5);
Game.Renderer.SpriteRenderer.DrawSprite(pipImages.Image, pos, wr.Palette("chrome"));
}
示例3: DrawControlGroup
IEnumerable<IRenderable> DrawControlGroup(WorldRenderer wr, Actor self, int2 basePosition)
{
var group = self.World.Selection.GetControlGroupForActor(self);
if (group == null)
yield break;
var pipImages = new Animation(self.World, "pips");
var pal = wr.Palette(Info.Palette);
pipImages.PlayFetchIndex("groups", () => (int)group);
pipImages.Tick();
var pos = basePosition - (0.5f * pipImages.Image.Size).ToInt2() + new int2(9, 5);
yield return new UISpriteRenderable(pipImages.Image, pos, 0, pal, 1f);
}
示例4: Parachute
public Parachute(Player owner, float2 location, int altitude, Actor cargo)
{
this.location = location;
this.altitude = altitude;
this.cargo = cargo;
var rs = cargo.Trait<RenderSimple>();
var image = rs.anim.Name;
palette = rs.Palette(owner);
anim = new Animation(image);
if (anim.HasSequence("idle"))
anim.PlayFetchIndex("idle", () => 0);
else
anim.PlayFetchIndex("stand", () => 0);
anim.Tick();
paraAnim = new Animation("parach");
paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));
}
示例5: Parachute
public Parachute(Player owner, PPos location, int altitude, Actor cargo)
{
this.location = location;
this.altitude = altitude;
this.cargo = cargo;
var rs = cargo.Trait<RenderSimple>();
var image = rs.anim.Name;
palette = rs.Palette(owner);
anim = new Animation(image);
if (anim.HasSequence("idle"))
anim.PlayFetchIndex("idle", () => 0);
else
anim.PlayFetchIndex("stand", () => 0);
anim.Tick();
var pai = cargo.Info.Traits.GetOrDefault<ParachuteAttachmentInfo>();
paraAnim = new Animation(pai != null ? pai.ParachuteSprite : "parach");
paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));
if (pai != null) offset = pai.Offset;
}