the initial commit to the repo.
This commit is contained in:
parent
025c032b8c
commit
1b757591b9
264 changed files with 21882 additions and 0 deletions
55
stoopid.raw/RayCast.cs
Normal file
55
stoopid.raw/RayCast.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using EFT;
|
||||
using stupid.solutions.stupid.solutions.Data;
|
||||
using UnityEngine;
|
||||
|
||||
internal class RayCast
|
||||
{
|
||||
private static readonly LayerMask LayerMask = -2142957568;
|
||||
|
||||
private static RaycastHit _raycastHit;
|
||||
|
||||
public static Vector3 BarrelRayCast(Player gamePlayer)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (gamePlayer.Fireport == null)
|
||||
{
|
||||
return Vector3.zero;
|
||||
}
|
||||
Physics.Linecast(gamePlayer.Fireport.position, gamePlayer.Fireport.position - gamePlayer.Fireport.up * 1000f, out _raycastHit);
|
||||
return _raycastHit.point;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 BarrelRayCastO(OnlineGamePlayer gamePlayer)
|
||||
{
|
||||
try
|
||||
{
|
||||
_ = gamePlayer.Player.ObservedPlayerController.HandsController.CurrentFireport.position;
|
||||
BifacialTransform currentFireport = gamePlayer.Player.ObservedPlayerController.HandsController.CurrentFireport;
|
||||
Physics.Linecast(currentFireport.position, currentFireport.position - currentFireport.up * 1000f, out _raycastHit);
|
||||
return _raycastHit.point;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
public static string BarrelRayCastTest(Player gamePlayer)
|
||||
{
|
||||
try
|
||||
{
|
||||
Physics.Linecast(gamePlayer.Fireport.position, gamePlayer.Fireport.position - gamePlayer.Fireport.up * 1000f, out _raycastHit);
|
||||
return _raycastHit.transform.name;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "Unkown";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue