Пример #1
0
    private void ClickHandle(Point p)
    {
        TLogger.Instance.Log(string.Concat(new object[]
        {
            "C: ",
            this.colorSourceText.GetPixel(p.i, p.j),
            " to ",
            this.drawColor
        }));
        TLogger.Instance.Log(string.Concat(new object[]
        {
            "p: ",
            p,
            " index: ",
            p.i * this.colorSourceText.width + p.j
        }));
        int  num = this.paintEngine.texWidth * p.i + p.j;
        byte b   = this.paintEngine.source[num];

        if (b == 255)
        {
            UnityEngine.Debug.Log("Hit line");
            return;
        }
        Color32 color = new Color32(this.paintEngine.pixels[num * 4], this.paintEngine.pixels[num * 4 + 1], this.paintEngine.pixels[num * 4 + 2], byte.MaxValue);

        if (color.r == this.paintEngine.paintColor.r && color.g == this.paintEngine.paintColor.g && color.b == this.paintEngine.paintColor.b)
        {
            UnityEngine.Debug.Log("Repaint");
            return;
        }
        if (b < 253)
        {
            b += 1;
        }
        else
        {
            b = 0;
        }
        FloodTest.FillType fillType = this.fType;
        if (fillType != FloodTest.FillType.Slow)
        {
            if (fillType == FloodTest.FillType.Fast)
            {
                FloodTest.FloodFill(p.j, p.i, this.paintEngine, b);
                this.drawText.LoadRawTextureData(this.paintEngine.pixels);
                this.drawText.Apply(false);
                TLogger.Instance.Log(Time.realtimeSinceStartup - this.time);
            }
        }
        else
        {
            base.StartCoroutine(this.SlowFill(p.j, p.i, this.paintEngine, b));
        }
    }
Пример #2
0
    private void ClickHandleTwo(Point p)
    {
        int  num = this.paintEngine.texWidth * p.j + p.i;
        byte b   = this.paintEngine.source[num];

        if (b == 255)
        {
            UnityEngine.Debug.Log("Hit line");
            return;
        }
        Color32 color  = new Color32(this.paintEngine.pixels[num * 4], this.paintEngine.pixels[num * 4 + 1], this.paintEngine.pixels[num * 4 + 2], byte.MaxValue);
        Color   color2 = this.paintEngine.sourceColors[(int)((float)this.paintEngine.texWidth / 16f * (float)p.j + (float)p.i / 4f)];

        TLogger.Instance.Log(string.Concat(new object[]
        {
            "C: ",
            color,
            " to ",
            this.drawColor,
            " exp: ",
            color2
        }));
        if (color2.r == (float)this.paintEngine.paintColor.r && color2.g == (float)this.paintEngine.paintColor.g && color2.b == (float)this.paintEngine.paintColor.b)
        {
            UnityEngine.Debug.Log("Repaint");
            return;
        }
        if (b < 253)
        {
            b += 1;
        }
        else
        {
            b = 0;
        }
        FloodTest.FillType fillType = this.fType;
        if (fillType != FloodTest.FillType.Slow)
        {
            if (fillType == FloodTest.FillType.Fast)
            {
                FloodTest.FloodFill(p.i, p.j, this.paintEngine, b);
                this.drawText.LoadRawTextureData(this.paintEngine.pixels);
                this.drawText.Apply(false);
                TLogger.Instance.Log(Time.realtimeSinceStartup - this.time);
            }
        }
        else
        {
            base.StartCoroutine(this.SlowFill(p.i, p.j, this.paintEngine, b));
        }
    }