UnityEngine.RectTransformUtility.ScreenPointToRay(UnityEngine.Camera, UnityEngine.Vector2)

Here are the examples of the csharp api UnityEngine.RectTransformUtility.ScreenPointToRay(UnityEngine.Camera, UnityEngine.Vector2) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 View Source File : TMP_TextUtilities.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

public static bool ScreenPointToWorldPointInRectangle(Transform transform, Vector2 screenPoint, Camera cam, out Vector3 worldPoint)
        {
            worldPoint = (Vector3)Vector2.zero;
            Ray ray = RectTransformUtility.ScreenPointToRay(cam, screenPoint);

            float enter;
            if (!new Plane(transform.rotation * Vector3.back, transform.position).Raycast(ray, out enter))
                return false;

            worldPoint = ray.GetPoint(enter);

            return true;
        }

19 View Source File : UnityEngine_RectTransformUtility_Wrap.cs
License : MIT License
Project Creator : focus-creative-games

[Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void F_ScreenPointToRay(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                
                
                
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    
                    
                    
                    {
                        
                        var Arg0 = argHelper0.Get<UnityEngine.Camera>(false);
                        var Arg1 = argHelper1.Get<UnityEngine.Vector2>(false);
                        var result = UnityEngine.RectTransformUtility.ScreenPointToRay(Arg0,Arg1);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        
                    }
                }
                
                
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }