コード例 #1
0
        public void Raycast(List <RaycastResult> results)
        {
            PointerEventData eventData = new PointerEventData(m_editor.EventSystem);

            eventData.position = m_input.GetPointerXY(0);
            m_raycaster.Raycast(eventData, results);
        }
コード例 #2
0
        private bool IsPointerOverSubmenu(PointerEventData eventData)
        {
            List <RaycastResult> raycastResultList = new List <RaycastResult>();

            m_raycaster.Raycast(eventData, raycastResultList);
            for (int i = 0; i < raycastResultList.Count; ++i)
            {
                RaycastResult raycastResult = raycastResultList[i];
                if (raycastResult.gameObject == m_submenu.gameObject)
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
    private static int Raycast(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 3);
            BaseRaycaster        baseRaycaster    = (BaseRaycaster)ToLua.CheckObject(L, 1, typeof(BaseRaycaster));
            PointerEventData     eventData        = (PointerEventData)ToLua.CheckObject(L, 2, typeof(PointerEventData));
            List <RaycastResult> resultAppendList = (List <RaycastResult>)ToLua.CheckObject(L, 3, typeof(List <RaycastResult>));
            baseRaycaster.Raycast(eventData, resultAppendList);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    public static int Raycast(IntPtr l)
    {
        int result;

        try
        {
            BaseRaycaster    baseRaycaster = (BaseRaycaster)LuaObject.checkSelf(l);
            PointerEventData eventData;
            LuaObject.checkType <PointerEventData>(l, 2, out eventData);
            List <RaycastResult> resultAppendList;
            LuaObject.checkType <List <RaycastResult> >(l, 3, out resultAppendList);
            baseRaycaster.Raycast(eventData, resultAppendList);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #5
0
ファイル: Util.cs プロジェクト: hamtol2/D2EEditor
        // UI RayCaster.
        public static bool GetRaycastResult(BaseRaycaster raycaster, EventSystem eventSystem, Vector2 mousePosition, out RaycastResult result)
        {
            result = new RaycastResult();
            PointerEventData data = new PointerEventData(eventSystem);

            data.position = Input.mousePosition;
            List <RaycastResult> results = new List <RaycastResult>();

            raycaster.Raycast(data, results);

            if (results.Count > 0)
            {
                result = results[0];
                return(true);
            }

            else
            {
                return(false);
            }
        }