Beispiel #1
0
    void OnTriggerEnter2D(Collider2D _col)
    {
        pixelGrid = _col.gameObject.GetComponent <SpritePixelGrid>();
        if (isDown)
        {
            if (eraserMode)
            {
                pixelGrid.UpdateColor(Color.white);
            }
            else if (spoidMode)
            {
                if (spoidAction != null)
                {
                    spoidAction.Invoke(pixelGrid.color);
                }

                ChangeColor(pixelGrid.color);
            }
            else
            {
                pixelGrid.UpdateColor(brushColor);
            }
        }
        else
        {
            if (spoidMode)
            {
                if (spoidAction != null)
                {
                    spoidAction.Invoke(pixelGrid.color);
                }
            }
            else
            {
                pixelGrid.UpdateOverColor(true, Color.gray);
            }
        }
    }
Beispiel #2
0
 void OnTriggerExit2D(Collider2D _col)
 {
     pixelGrid = _col.gameObject.GetComponent <SpritePixelGrid>();
     pixelGrid.UpdateOverColor(false, Color.white);
 }