コード例 #1
0
        public override void DrawTurret()
        {
            Vector3   offset         = new Vector3(parentTurret.def.building.turretTopOffset.x, 0f, parentTurret.def.building.turretTopOffset.y).RotatedBy(CurRotation);
            Vector3   vectorRecoiled = Ext_Math.PointFromAngle(offset, -curRecoil, CurRotation);
            float     drawSize       = parentTurret.def.building.turretTopDrawSize;
            Matrix4x4 matrix         = default;

            matrix.SetTRS(parentTurret.DrawPos + altitudeDrawLayer + Altitudes.AltIncVect + vectorRecoiled, (CurRotation + ArtworkRotation).ToQuat(), new Vector3(drawSize, 1f, drawSize));
            Graphics.DrawMesh(MeshPool.plane10, matrix, TurretGraphic?.MatAt(parentTurret.Rotation) ?? parentTurret.def.building.turretTopMat, 0);
            if (DrawLayer != null)
            {
                DrawLayer.DrawExtra(parentTurret.DrawPos + altitudeDrawLayer + Altitudes.AltIncVect + offset, CurRotation);
            }
        }