Beispiel #1
0
 public void SwitchMode(PainterMode newMode)
 {
     if (Mode != newMode)
     {
         TileMouseUp(null);
     }
     Mode         = newMode;
     OriginalData = null;
 }
Beispiel #2
0
    public void Paint(Vector2 pos, bool useAltMode = false)
    {
        PainterMode modeToUse = useAltMode ? altMode : mode;

        mat.SetVector("_Pos", new Vector4(pos.x, pos.y, 0, 0));
        mat.SetColor("_Color", modeToUse == PainterMode.subtract ? color * -1 : color);
        mat.SetFloat("_Radius", radius);
        mat.SetInt("_DstMode", (int)(mode == PainterMode.equals ? BlendMode.OneMinusSrcAlpha : BlendMode.One));
        mat.SetInt("_Pattern", (int)pattern);

        Graphics.Blit(
            shaderRunner.CurrentBuffer,
            shaderRunner.CurrentBuffer,
            mat
            );
    }