public override void PostDraw()
        {
            //IL_000a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0018: Unknown result type (might be due to invalid IL or missing references)
            //IL_001d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0027: Unknown result type (might be due to invalid IL or missing references)
            //IL_002c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Unknown result type (might be due to invalid IL or missing references)
            //IL_0038: Unknown result type (might be due to invalid IL or missing references)
            //IL_003d: Unknown result type (might be due to invalid IL or missing references)
            //IL_007f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0084: Unknown result type (might be due to invalid IL or missing references)
            //IL_0090: Unknown result type (might be due to invalid IL or missing references)
            //IL_0091: Unknown result type (might be due to invalid IL or missing references)
            //IL_0096: Unknown result type (might be due to invalid IL or missing references)
            ((CompPowerTrader)this).PostDraw();
            FillableBarRequest val = default(FillableBarRequest);

            val.center      = ((Thing)base.parent).DrawPos + Vector3.up * 0.1f;
            val.size        = BarSize;
            val.fillPercent = ((CompPowerTrader)this).PowerOutput / 3000f;
            val.filledMat   = PowerPlantHempSolarBarFilledMat;
            val.unfilledMat = PowerPlantHempSolarBarUnfilledMat;
            val.margin      = 0.15f;
            Rot4 rotation = ((Thing)base.parent).Rotation;

            ((Rot4)(rotation)).Rotate((RotationDirection)1);
            val.rotation = rotation;
            GenDraw.DrawFillableBar(val);
        }
Пример #2
0
        public static void DrawFillableBar(FillableBarRequest r)
        {

            Vector2 vector = r.preRotationOffset.RotatedBy(r.rotation.AsAngle);

            r.center += new Vector3(vector.x, 0f, vector.y);

            Vector3 s2 = new Vector3(r.size.x, 1f, r.size.y);
            Matrix4x4 matrix2 = default(Matrix4x4);
            Vector3 pos2 = r.center + Vector3.up * 0.009f;

            matrix2.SetTRS(pos2, r.rotation.AsQuat, s2);
            Graphics.DrawMesh(MeshPool.plane10, matrix2, r.matback, 0);


            if (r.fillPercent > 0.001f)
            {
                Vector3 s = new Vector3(r.size.x * r.fillPercent, 1f, r.size.y);
                Matrix4x4 matrix = default(Matrix4x4);
                Vector3 pos = r.center + Vector3.up * 0.01f;

                if (r.rotation == Rot4.West) //North
                {
                    pos.z = pos.z - (r.size.x * 0.5f);
                    pos.z = pos.z + (0.5f * r.size.x * r.fillPercent);
                }
                if (r.rotation == Rot4.North) //East
                {
                    pos.x = pos.x - (r.size.x * 0.5f);
                    pos.x = pos.x + (0.5f * r.size.x * r.fillPercent);
                }
                if (r.rotation == Rot4.East) //South
                {
                    pos.z = pos.z + (r.size.x * 0.5f);
                    pos.z = pos.z - (0.5f * r.size.x * r.fillPercent);
                }
                if (r.rotation == Rot4.South) //West
                {
                    pos.x = pos.x + (r.size.x * 0.5f);
                    pos.x = pos.x - (0.5f * r.size.x * r.fillPercent);
                }

                matrix.SetTRS(pos, r.rotation.AsQuat, s);
                Graphics.DrawMesh(MeshPool.plane10, matrix, r.mat, 0);

            }
        }
Пример #3
0
        public static void DrawFillableBar(FillableBarRequest r)
        {
            Vector2 vector = r.preRotationOffset.RotatedBy(r.rotation.AsAngle);

            r.center += new Vector3(vector.x, 0f, vector.y);

            Vector3   s2      = new Vector3(r.size.x, 1f, r.size.y);
            Matrix4x4 matrix2 = default(Matrix4x4);
            Vector3   pos2    = r.center + Vector3.up * 0.009f;

            matrix2.SetTRS(pos2, r.rotation.AsQuat, s2);
            Graphics.DrawMesh(MeshPool.plane10, matrix2, r.matback, 0);


            if (r.fillPercent > 0.001f)
            {
                Vector3   s      = new Vector3(r.size.x * r.fillPercent, 1f, r.size.y);
                Matrix4x4 matrix = default(Matrix4x4);
                Vector3   pos    = r.center + Vector3.up * 0.01f;

                if (r.rotation == Rot4.West) //North
                {
                    pos.z = pos.z - (r.size.x * 0.5f);
                    pos.z = pos.z + (0.5f * r.size.x * r.fillPercent);
                }
                if (r.rotation == Rot4.North) //East
                {
                    pos.x = pos.x - (r.size.x * 0.5f);
                    pos.x = pos.x + (0.5f * r.size.x * r.fillPercent);
                }
                if (r.rotation == Rot4.East) //South
                {
                    pos.z = pos.z + (r.size.x * 0.5f);
                    pos.z = pos.z - (0.5f * r.size.x * r.fillPercent);
                }
                if (r.rotation == Rot4.South) //West
                {
                    pos.x = pos.x + (r.size.x * 0.5f);
                    pos.x = pos.x - (0.5f * r.size.x * r.fillPercent);
                }

                matrix.SetTRS(pos, r.rotation.AsQuat, s);
                Graphics.DrawMesh(MeshPool.plane10, matrix, r.mat, 0);
            }
        }
Пример #4
0
        public static void DrawFillableBar(FillableBarRequest r)
        {
            Vector2 vector = r.preRotationOffset.RotatedBy(r.rotation.AsAngle);

            r.center += new Vector3(vector.x, 0f, vector.y);
            if (r.rotation == Rot4.South)
            {
                r.rotation = Rot4.North;
            }
            if (r.rotation == Rot4.West)
            {
                r.rotation = Rot4.East;
            }
            Vector3   s      = new Vector3(r.size.x + r.margin, 1f, r.size.y + r.margin);
            Matrix4x4 matrix = default(Matrix4x4);

            matrix.SetTRS(r.center, r.rotation.AsQuat, s);
            Graphics.DrawMesh(MeshPool.plane10, matrix, r.unfilledMat, 0);
            if (r.fillPercent > 0.001f)
            {
                s      = new Vector3(r.size.x * r.fillPercent, 1f, r.size.y);
                matrix = default(Matrix4x4);
                Vector3 pos = r.center + Vector3.up * 0.01f;
                if (!r.rotation.IsHorizontal)
                {
                    pos.x -= r.size.x * 0.5f;
                    pos.x += 0.5f * r.size.x * r.fillPercent;
                }
                else
                {
                    pos.z -= r.size.x * 0.5f;
                    pos.z += 0.5f * r.size.x * r.fillPercent;
                }
                matrix.SetTRS(pos, r.rotation.AsQuat, s);
                Graphics.DrawMesh(MeshPool.plane10, matrix, r.filledMat, 0);
            }
        }