Exemplo n.º 1
0
    private void OnMouseOver()
    {
        if (!pbn.PbnSequenceActive)
        {
            return;
        }

        Ray        ray = Camera.main.ViewportPointToRay(Camera.main.ScreenToViewportPoint(Input.mousePosition));
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 1000))
        {
            Color c = GetColorAtPoint(hit.point);
            debugHit = c;


            if (ColorX.Approximately(c, Color.green))
            {
                paintedNumber = ColorCell.ActiveNumber;
                Valid         = paintedNumber == colorCell.CellNumber;

                SetColor(spriteRenderer);
            }
        }
    }