Exemplo n.º 1
0
    void OnMouseDrag()
    {
        Vector3 MWP = GLOBAL.GetMouseWorldPosition();

        transform.position = new Vector3(Mathf.RoundToInt(MWP.x), Mathf.RoundToInt(MWP.y), Mathf.RoundToInt(MWP.z));

        if (transform.position == new Vector3(5, 5, 0))
        {
            rend.material = ChangeTo;
        }
        else
        {
            rend.material = Default;
        }
    }