public RenderInfantry(Actor self, RenderInfantryInfo info) : base(self, RenderSimple.MakeFacingFunc(self)) { Info = info; anim.PlayFetchIndex(NormalizeInfantrySequence(self, "stand"), () => 0); State = AnimationState.Waiting; mobile = self.Trait <Mobile>(); }
public WithHarvestAnimation(Actor self, WithHarvestAnimationInfo info) { this.info = info; var rs = self.Trait <RenderSprites>(); var body = self.Trait <IBodyOrientation>(); anim = new Animation(rs.GetImage(self), RenderSimple.MakeFacingFunc(self)); anim.Play(info.Sequence); rs.anims.Add("harvest_{0}".F(info.Sequence), new AnimationWithOffset(anim, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), () => !visible, p => WithTurret.ZOffsetFromCenter(self, p, 0))); }
public RenderUnit(Actor self) : base(self, RenderSimple.MakeFacingFunc(self)) { anim.PlayRepeating("idle"); }