Пример #1
0
        private static Material MatFromColorPct(float colorPct, bool transparent)
        {
            int num = Mathf.RoundToInt(colorPct * 100f);

            num = GenMath.PositiveMod(num, 100);
            return(DebugMatsSpectrum.Mat(num, transparent));
        }
Пример #2
0
        private static Material MatFromColorPct(float colorPct, bool transparent)
        {
            int x = Mathf.RoundToInt((float)(colorPct * 100.0));

            x = GenMath.PositiveMod(x, 100);
            return(DebugMatsSpectrum.Mat(x, transparent));
        }
Пример #3
0
 static DebugMatsSpectrum()
 {
     for (int i = 0; i < 100; i++)
     {
         DebugMatsSpectrum.spectrumMatsTranparent[i] = MatsFromSpectrum.Get(DebugMatsSpectrum.DebugSpectrumWithOpacity(0.25f), (float)i / 100f);
         DebugMatsSpectrum.spectrumMatsOpaque[i]     = MatsFromSpectrum.Get(DebugMatsSpectrum.DebugSpectrumWithOpacity(1f), (float)i / 100f);
     }
 }
Пример #4
0
        public Color GetCellExtraColor(int index)
        {
            IntVec3  c        = map.cellIndices.IndexToCell(index);
            int      num      = CountAt(c);
            ThingDef thingDef = ThingDefAt(c);

            return(DebugMatsSpectrum.Mat(Mathf.RoundToInt((float)num / (float)thingDef.deepCountPerCell / 2f * 100f) % 100, transparent: true).color);
        }
        public Color GetCellExtraColor(int index)
        {
            IntVec3  c        = this.map.cellIndices.IndexToCell(index);
            int      num      = this.CountAt(c);
            ThingDef thingDef = this.ThingDefAt(c);
            float    num2     = (float)num / (float)thingDef.deepCountPerCell / 2f;
            int      num3     = Mathf.RoundToInt(num2 * 100f);

            num3 %= 100;
            return(DebugMatsSpectrum.Mat(num3, true).color);
        }
 static DebugMatsSpectrum()
 {
     DebugMatsSpectrum.spectrumMatsTranparent = new Material[100];
     DebugMatsSpectrum.spectrumMatsOpaque     = new Material[100];
     DebugMatsSpectrum.DebugSpectrum          = new Color[5]
     {
         new Color(0.75f, 0f, 0f),
         new Color(0.5f, 0.3f, 0f),
         new Color(0f, 1f, 0f),
         new Color(0f, 0f, 1f),
         new Color(0.7f, 0f, 1f)
     };
     for (int i = 0; i < 100; i++)
     {
         DebugMatsSpectrum.spectrumMatsTranparent[i] = MatsFromSpectrum.Get(DebugMatsSpectrum.DebugSpectrumWithOpacity(0.25f), (float)((float)i / 100.0));
         DebugMatsSpectrum.spectrumMatsOpaque[i]     = MatsFromSpectrum.Get(DebugMatsSpectrum.DebugSpectrumWithOpacity(1f), (float)((float)i / 100.0));
     }
 }
Пример #7
0
 private static Material MatFromColorPct(float colorPct, bool transparent)
 {
     return(DebugMatsSpectrum.Mat(GenMath.PositiveMod(Mathf.RoundToInt(colorPct * 100f), 100), transparent));
 }