示例#1
0
    void OnFocusChange(System.Object sender, FocusEventArgs args)
    {
        bool focused = args.Focus;

        FocusManager.Inst.UpdateFocusID(browserTexture.id, focused, browserTexture.URL, GameManager.Inst.LevelLoaded != GameManager.Level.ORIENT && (!focused || GameManager.Inst.LevelLoaded != GameManager.Level.OFFICE || !GameGUI.Inst.allowPresenterTool), browserTexture.minWriteAccessType);

        if (!focused)
        {
            GameObject hitObj = MouseHelpers.GetCurrentGameObjectHit();
            if (hitObj != null && hitObj.GetComponent <WebToolBarItem>() != null && hitObj.GetComponent <SnapToScreenOnClick>() == null)
            {
                browserTexture.Focus();
                return;
            }
        }
        if (goToActivateOnFocus != null)
        {
            goToActivateOnFocus.SetActive(focused);
            if (focused && goToActivateOnFocus.name == "screenglow")
            {
                Color         c   = new Color(0.286f, 0.32f, 1.0f, 0.5f);
                TeamWebScreen tws = GetComponent <TeamWebScreen>();
                if (tws != null && tws.IsParseControlled)
                {
                    c = new Color(0.98823529411f, 1.0f, 0.16862745098f);
                }
                if (browserTexture.minWriteAccessType > PlayerType.NORMAL && browserTexture.minWriteAccessType > GameManager.Inst.LocalPlayerType)
                {
                    c = new Color(1.0f, 0.286f, 0.286f, 0.5f);
                }

                goToActivateOnFocus.GetComponent <Renderer>().material.SetColor("_TintColor", c);
            }
        }

        bool snapCamInUse = MainCameraController.Inst.cameraType == CameraType.SNAPCAM;

        if (focusLossReleasesSnapCam && snapCamInUse && browserTexture.SnapCamOnMe && !focused)
        {
            browserTexture.ToggleSnapCameraToObject();
        }
        if (focusGainEngagesSnapCam && !snapCamInUse && focused)
        {
            browserTexture.ToggleSnapCameraToObject();
        }
        allowZoomInMsg = true;
    }
示例#2
0
    // List of callbacks that can be registered

    public void RegisterZoom()
    {
        RegisterNotificationCallback("Zoom", delegate(JSValue[] args)
        {
            if (MainCameraController.Inst.cameraType != CameraType.SNAPCAM && (!ReplayManager.Initialized || !ReplayManager.Inst.Playing))
            {
                bTex.ToggleSnapCameraToObject();
            }
        });
    }
示例#3
0
    void OnGUI()
    {
        if (screenToSnapTo != null && Event.current != null && Event.current.type == EventType.MouseUp && MouseHelpers.GetCurrentGameObjectHit() == gameObject)
        {
            if (browserTexture == null)
            {
                browserTexture = screenToSnapTo.GetComponent <CollabBrowserTexture>();
            }
            if (browserTexture != null)
            {
                Event.current.Use();
                browserTexture.ToggleSnapCameraToObject();
                if (MainCameraController.Inst.cameraType == CameraType.SNAPCAM)
                {
                    browserTexture.Focus();
                }
            }

            SoundManager.Inst.PlayClick();
        }
    }