Ejemplo n.º 1
0
        public GraphObject3DImpl()
        {
            this.m_u3dObj = new GameObject();
            Object3DBehaviour object3DBehaviour = this.m_u3dObj.AddComponent <Object3DBehaviour>();

            object3DBehaviour.obj = this;
            this.layer            = 0;
            this.m_u3dPos         = this.m_u3dObj.transform.localPosition;
            this.m_u3dRot         = this.m_u3dObj.transform.localEulerAngles;
            this.m_u3dScale       = this.m_u3dObj.transform.localScale;
        }
Ejemplo n.º 2
0
        public IGraphObject3D rayCast(Vec3 vec)
        {
            Variant        variant = new Variant();
            Ray            ray     = this.m_cam.ScreenPointToRay(new Vector3(vec.x, vec.y, vec.z));
            RaycastHit     raycastHit;
            bool           flag = Physics.Raycast(ray, out raycastHit);
            IGraphObject3D result;

            if (flag)
            {
                Object3DBehaviour component = raycastHit.transform.gameObject.GetComponent <Object3DBehaviour>();
                bool flag2 = component != null;
                if (flag2)
                {
                    result = component.obj;
                    return(result);
                }
            }
            result = null;
            return(result);
        }
Ejemplo n.º 3
0
        public List <IGraphObject3D> rayCastAll(Vec3 vec)
        {
            List <IGraphObject3D> list = new List <IGraphObject3D>();
            Ray ray = this.m_cam.ScreenPointToRay(new Vector3(vec.x, vec.y, vec.z));

            RaycastHit[] array = Physics.RaycastAll(ray);
            bool         flag  = array != null;

            if (flag)
            {
                RaycastHit[] array2 = array;
                for (int i = 0; i < array2.Length; i++)
                {
                    RaycastHit        raycastHit = array2[i];
                    Object3DBehaviour component  = raycastHit.transform.gameObject.GetComponent <Object3DBehaviour>();
                    bool flag2 = component != null;
                    if (flag2)
                    {
                        list.Add(component.obj);
                    }
                }
            }
            return(list);
        }