/// <summary> /// Initializes a new instance of the <see cref="TouchHit"/> struct. /// </summary> /// <param name="transform"> Target transform. </param> public TouchHit(Transform transform) { this.transform = transform; raycastHit = default(RaycastHit); raycastHit2D = default(RaycastHit2D); raycastResult = default(RaycastResult); type = TouchHitType.Hit3D; }
/// <summary> /// Initializes a new instance of the <see cref="TouchHit"/> struct from a UI raycast. /// </summary> /// <param name="value"> UI raycast value. </param> public TouchHit(RaycastResult value) : this(value.gameObject.transform) { raycastResult = value; type = TouchHitType.HitUI; }
/// <summary> /// Initializes a new instance of the <see cref="TouchHit"/> struct from a 2D raycast. /// </summary> /// <param name="value"> 2D raycast value. </param> public TouchHit(RaycastHit2D value) : this(value.collider.transform) { raycastHit2D = value; type = TouchHitType.Hit2D; }
/// <summary> /// Initializes a new instance of the <see cref="TouchHit"/> struct from a UI raycast. /// </summary> /// <param name="value"> UI raycast value. </param> public TouchHit(RaycastResult value) : this(value.gameObject.transform) { raycastResult = value; type = TouchHitType.HitUI; }
/// <summary> /// Initializes a new instance of the <see cref="TouchHit"/> struct from a 2D raycast. /// </summary> /// <param name="value"> 2D raycast value. </param> public TouchHit(RaycastHit2D value) : this(value.collider.transform) { raycastHit2D = value; type = TouchHitType.Hit2D; }
/// <summary> /// Initializes a new instance of the <see cref="TouchHit"/> struct. /// </summary> /// <param name="transform"> Target transform. </param> public TouchHit(Transform transform) { this.transform = transform; raycastHit = default(RaycastHit); raycastHit2D = default(RaycastHit2D); raycastResult = default(RaycastResult); type = TouchHitType.Hit3D; }