protected AbstractParser LoadColorMap(Dictionary <string, byte[]> files)
        {
            var fileName = "color-map.png";

            if (files.ContainsKey(fileName))
            {
//                UnityEngine.Debug.Log("Create color map");

//                var tex = ReadTexture(files[fileName]);

                // Create new color map chip
                var colorMapChip = new ColorChip();

                // Add the chip to the engine
                targetEngine.ActivateChip(ColorMapParser.chipName, colorMapChip, false);

//                targetEngine.colorMapChip = colorMapChip;

                var imageParser = new PNGReader(files[fileName], targetEngine.colorChip.maskColor);

                // Pass the chip to the new parser
                return(new ColorMapParser(imageParser, colorMapChip, maskColor));
            }

            return(null);
        }
Exemple #2
0
        protected AbstractParser LoadColorMap(string[] files)
        {
            // var fileName = "color-map.png";

            var file = files.FirstOrDefault(x => x.EndsWith("color-map.png"));

            if (!string.IsNullOrEmpty(file))
            {
                // Create new color map chip
                var colorMapChip = new ColorChip();

                // Add the chip to the engine
                targetEngine.ActivateChip(ColorMapParser.chipName, colorMapChip, false);

                //                targetEngine.colorMapChip = colorMapChip;

                var imageParser = new PNGFileReader(file, _fileLoadHelper, targetEngine.ColorChip.maskColor);

                // Pass the chip to the new parser
                return(new ColorMapParser(imageParser, colorMapChip, maskColor));
            }

            return(null);
        }