RimworldMod作成チュートリアル4ソーラー発電機を書く



Rimworld Mod Making Tutorial 4 Write Solar Generator



私たちの発電機にバッテリーバーがないのはいつも奇妙に見えるので、すぐにキーボードを手に取ってそれを描きます。

/// /// Drawing method /// public override void Draw() { base.Draw() GenDraw.FillableBarRequest fbr = default(GenDraw.FillableBarRequest) //Initialize a fill bar fbr.center = DrawPos + Vector3.up * 0.1f//Drawing center fbr.size = new Vector2(2.3f, 0.14f)//size fbr.fillPercent = realPower / fullSunPower//fill ratio fbr.filledMat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(0.5f, 0.475f, 0.1f), false)//The color of the filled part fbr.unfilledMat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(0.15f, 0.15f, 0.15f), false)//The color of the unfilled part fbr.margin = 0.15f//spacing Rot4 rot4 = Rotation//rotation rot4.Rotate(RotationDirection.Clockwise)//Adjust the rotation of the material fbr.rotation = rot4 GenDraw.DrawFillableBar(fbr)//Come out the battery bar! }

効果は偽物です
画像
ソースリンク