示例#1
0
    //--------------------------------------------------

    //--------------------------------------------------
    private void HandlePointerIn(object sender, PointerEventArgs e)
    //--------------------------------------------------
    {
        if (e.target.CompareTag("Switchable"))
        {
            currentSmallMonitor = e.target.gameObject;
            originalColor       = currentSmallMonitor.GetComponent <Renderer>().material.color;
            //Color tempColor = Color.blue;
            currentSmallMonitor.GetComponent <Renderer>().material.color = Color.blue;
        }

        var button = e.target.GetComponent <Button>();

        if (button != null)
        {
            button.Select();
        }

        WatchButtonManager arrow = e.target.GetComponent <WatchButtonManager>();

        if (arrow != null)
        {
            arrow.PointerEnter();
        }

        #region Attempt at moving camera feeds
        //if (e.target.CompareTag("Grabbable"))
        //{
        //    currentMonitor = e.target.transform.root.gameObject;
        //    Debug.Log("pointer in Monitor");
        //    Debug.Log("current set object = " + currentMonitor.name);
        //highlightMeshRend = e.target.GetComponent<MeshRenderer>();
        //highlightMeshRend.enabled = true;

        //right now:
        //pointer in, can select
        //trigger select, trigger again deselect,
        //but since rightafter you delect, it's pointer in again!
        //monitorSelected = true;

        //{
        //    currentMonitor = null;
        //    Debug.Log("current set object = " + currentMonitor.name);
        //}
        #endregion
    }
示例#2
0
    //--------------------------------------------------

    //--------------------------------------------------
    private void HandlePointerOut(object sender, PointerEventArgs e)
    //--------------------------------------------------
    {
        #region Attempt at moving camera feeds
        //if (e.target.CompareTag("Grabbable"))
        //{
        //    EventSystem.current.SetSelectedGameObject(null);
        //    currentMonitor = null;
        //    Debug.Log("pointer out");
        //    Debug.Log("pointer out, current = " + currentMonitor.name);
        //}

        //if (e.target.comparetag("grabbable"))
        //{
        //    //highlightmeshrend = e.target.getcomponent<meshrenderer>();
        //    //highlightmeshrend.enabled = false;
        //    currentmonitor = null;
        //    //monitorselected = false;
        //    debug.log("pointer out");
        //    debug.log("pointer out, current = " + currentmonitor.name);
        //}
        #endregion
        if (e.target.CompareTag("Switchable"))
        {
            if (currentSmallMonitor != null)
            {
                currentSmallMonitor.GetComponent <Renderer>().material.color = originalColor;
                currentSmallMonitor = null;
            }
        }

        var button = e.target.GetComponent <Button>();
        if (button != null)
        {
            EventSystem.current.SetSelectedGameObject(null);
        }

        WatchButtonManager arrow = e.target.GetComponent <WatchButtonManager>();
        if (arrow != null)
        {
            arrow.PointerExit();
            EventSystem.current.SetSelectedGameObject(null);
        }
    }