12345678910111213141516171819202122 |
- using System;
- using UnityEngine;
- public class OvrEyeRay : MonoBehaviour
- {
- public Ray GetRay()
- {
- this.m_ray.origin = base.transform.position;
- this.m_ray.direction = base.transform.forward;
- return this.m_ray;
- }
- public bool RayCast(out RaycastHit f_hitInfo, float f_maxDistance, int f_layerMask)
- {
- this.m_ray.origin = base.transform.position;
- this.m_ray.direction = base.transform.forward;
- Debug.DrawLine(this.m_ray.origin, this.m_ray.direction * f_maxDistance, Color.yellow);
- return Physics.Raycast(this.m_ray, out f_hitInfo, f_maxDistance, f_layerMask);
- }
- private Ray m_ray = default(Ray);
- }
|