コード例 #1
0
    public override void Raycast(PointerEventData eventData, List <RaycastResult> resultAppendList)
    {
        if (MultiDisplayUtil.GetCurrentDisplay() != (int)displayIndex)
        {
            return;
        }

        base.Raycast(eventData, resultAppendList);
    }
コード例 #2
0
    protected override void Update()
    {
        if (MultiDisplayUtil.GetCurrentDisplay() == (int)displayIndex)
        {
            if (current != this)
            {
                current = this;
            }
        }
        else
        {
            return;
        }

        base.Update();
    }
コード例 #3
0
    /// <summary>
    /// 获取不同屏幕的事件相机,zspace屏默认一定为1屏
    /// </summary>
    /// <returns></returns>
    public static Camera GetCurrentEventCamera()
    {
        Camera current;
        bool   isFirstDisplay  = MultiDisplayUtil.GetCurrentDisplay() == DisplayIndex.Display1;
        bool   isSecondDisplay = MultiDisplayUtil.GetCurrentDisplay() == DisplayIndex.Display2;
        bool   isZspaceDisplay = PlateformData.GetCurrentPlatform() == PlatformType.zSpace;

        if (isFirstDisplay)
        {
            current = isZspaceDisplay ? PlateformData.zCore._screenPointToRayCamera : Camera.main;
        }
        //else if (isSecondDisplay)
        //{
        //    current = GameObject.Find("SecondCamera").GetComponent<Camera>();
        //}
        else
        {
            current = Camera.main;
        }
        return(current);
    }