Inheritance: MonoBehaviour
Exemple #1
0
        /// <summary>
        /// Get all items that are intersected by the raycast
        /// </summary>
        /// <param name="ray">Ray for fetching items</param>
        /// <param name="rayCastTest">A callback to determine whether an item actually is intersected by the ray. The method only finds objects whose bounds intersect the ray, you must define how to raycast against the actual object</param>
        /// <param name="items">The items hit by the raycast</param>
        public void Raycast(Ray ray, RaycastTest rayCastTest, out ICollection <T> items)
        {
            items = new Collection <T>();

            root.Query(nodeBounds => nodeBounds.RayIntersects(ray), ref items);

            items = items.Where(t => rayCastTest(t, ray)).ToList();
        }
Exemple #2
0
	// Use this for initialization
	void Start () {
		an = PlayerModel.GetComponent <Animator> ();
		an_arm = Arms.GetComponent <Animator> ();

		rct = gun.GetComponent <RaycastTest> ();

		cc = GetComponent <CharacterController> ();

		Gunshot = GetComponent <AudioSource>();

		normalFOV = MainCamera.fieldOfView;
	}