public override void SpawnSetup() { base.SpawnSetup(); AnimatedGraphic animation = (AnimatedGraphic)base.Graphic; animation.DefaultFrame = 11; }
public static AnimatedGraphic FromSingleFrame(Graphic frame) { int finalSlash = frame.path.LastIndexOf('/'); string path = frame.path.Substring(0, finalSlash); AnimatedGraphic anim = (AnimatedGraphic)GraphicDatabase.Get <AnimatedGraphic>(path, frame.shader, frame.drawSize, frame.color, frame.colorTwo); anim.DefaultFrame = Array.FindIndex(anim.subGraphics, row => row == frame); return(anim); }
public override void Tick() { base.Tick(); CompPowerTrader power = GetComp <CompPowerTrader>(); BeltComponent belt = GetComp <BeltComponent>(); if (Graphic.GetType() == typeof(AnimatedGraphic)) { AnimatedGraphic animation = (AnimatedGraphic)Graphic; if (animation.CurrentFrame != prevFrame) { Find.MapDrawer.MapChanged(Position, MapChangeType.Things, true, false); prevFrame = animation.CurrentFrame; } } }