Class HelperFunctions
- Namespace
- DefaultNamespace
- Assembly
- Assembly-CSharp.dll
public class HelperFunctions : MonoBehaviour
- Inheritance
-
HelperFunctions
- Inherited Members
-
- Extension Methods
-
Constructors
HelperFunctions()
Fields
AllMask
public static LayerMask AllMask
Field Value
- LayerMask
InteractableMask
public static LayerMask InteractableMask
Field Value
- LayerMask
PropMask
public static LayerMask PropMask
Field Value
- LayerMask
tangibleMask
public static LayerMask tangibleMask
Field Value
- LayerMask
terrainMask
public static LayerMask terrainMask
Field Value
- LayerMask
terrainPropMask
public static LayerMask terrainPropMask
Field Value
- LayerMask
Methods
AttachFixedJoint(Rigidbody, Rigidbody)
public static Joint AttachFixedJoint(Rigidbody rig1, Rigidbody rig2)
Parameters
rig1
Rigidbody
rig2
Rigidbody
Returns
- Joint
AttachPositionJoint(Rigidbody, Rigidbody, bool, Vector3)
public static ConfigurableJoint AttachPositionJoint(Rigidbody rig1, Rigidbody rig2, bool useCustomConnection = false, Vector3 customConnectionPoint = default)
Parameters
rig1
Rigidbody
rig2
Rigidbody
useCustomConnection
bool
customConnectionPoint
Vector3
Returns
- ConfigurableJoint
BoxDistance(Vector3, Vector3)
public static float BoxDistance(Vector3 pos1, Vector3 pos2)
Parameters
pos1
Vector3
pos2
Vector3
Returns
- float
public static bool CanSee(Transform looker, Vector3 pos, float maxAngle = 70)
Parameters
looker
Transform
pos
Vector3
maxAngle
float
Returns
- bool
CubicBezier(Vector3, Vector3, Vector3, Vector3, float)
public static Vector3 CubicBezier(Vector3 Start, Vector3 _P1, Vector3 _P2, Vector3 end, float _t)
Parameters
Start
Vector3
_P1
Vector3
_P2
Vector3
end
Vector3
_t
float
Returns
- Vector3
DestroyAll(Object[])
public static void DestroyAll(Object[] objects)
Parameters
objects
Object[]
DirectionToEuler(Vector3)
public static Vector3 DirectionToEuler(Vector3 dir)
Parameters
dir
Vector3
Returns
- Vector3
DirectionToLook(Vector3)
public static Vector3 DirectionToLook(Vector3 dir)
Parameters
dir
Vector3
Returns
- Vector3
EulerToDirection(Vector3, Vector3)
public static Vector3 EulerToDirection(Vector3 euler, Vector3 targetDir)
Parameters
euler
Vector3
targetDir
Vector3
Returns
- Vector3
EulerToLook(Vector2)
public static Vector3 EulerToLook(Vector2 euler)
Parameters
euler
Vector2
Returns
- Vector3
public static List<Transform> FindAllChildrenWithTag(string targetTag, Transform target)
Parameters
targetTag
string
target
Transform
Returns
- List<Transform>
public static Transform FindChildRecursive(string targetName, Transform root)
Parameters
targetName
string
root
Transform
Returns
- Transform
FlatAngle(Vector3, Vector3)
public static float FlatAngle(Vector3 dir1, Vector3 dir2)
Parameters
dir1
Vector3
dir2
Vector3
Returns
- float
FlatDistance(Vector3, Vector3)
public static float FlatDistance(Vector3 from, Vector3 to)
Parameters
from
Vector3
to
Vector3
Returns
- float
GetCameraDistanceMultiplier(Vector3, float)
public static float GetCameraDistanceMultiplier(Vector3 position, float range)
Parameters
position
Vector3
range
float
Returns
- float
GetGroundPos(Vector3, LayerType, float)
public static Vector3 GetGroundPos(Vector3 from, HelperFunctions.LayerType layerType, float radius = 0)
Parameters
from
Vector3
layerType
HelperFunctions.LayerType
radius
float
Returns
- Vector3
GetGroundPosRaycast(Vector3, LayerType, float)
public static RaycastHit GetGroundPosRaycast(Vector3 from, HelperFunctions.LayerType layerType, float radius = 0)
Parameters
from
Vector3
layerType
HelperFunctions.LayerType
radius
float
Returns
- RaycastHit
GetGroundPosRaycast(Vector3, LayerType, Vector3, float)
public static RaycastHit GetGroundPosRaycast(Vector3 from, HelperFunctions.LayerType layerType, Vector3 gravityDir, float radius = 0)
Parameters
from
Vector3
layerType
HelperFunctions.LayerType
gravityDir
Vector3
radius
float
Returns
- RaycastHit
GetLayer(LayerType)
public static int GetLayer(HelperFunctions.LayerType layerType)
Parameters
layerType
HelperFunctions.LayerType
Returns
- int
GetMask(LayerType)
public static LayerMask GetMask(HelperFunctions.LayerType layerType)
Parameters
layerType
HelperFunctions.LayerType
Returns
- LayerMask
GetRandomPositionInBounds(Bounds)
public static Vector3 GetRandomPositionInBounds(Bounds bounds)
Parameters
bounds
Bounds
Returns
- Vector3
GetRandomRotationWithUp(Vector3)
public static Quaternion GetRandomRotationWithUp(Vector3 normal)
Parameters
normal
Vector3
Returns
- Quaternion
GetRotationWithUp(Vector3, Vector3)
public static Quaternion GetRotationWithUp(Vector3 forward, Vector3 up)
Parameters
forward
Vector3
up
Vector3
Returns
- Quaternion
GetTerrain(Vector3)
public static Terrain GetTerrain(Vector3 center)
Parameters
center
Vector3
Returns
- Terrain
GetTotalBounds(GameObject)
public static Bounds GetTotalBounds(GameObject gameObject)
Parameters
gameObject
GameObject
Returns
- Bounds
GroundDirection(Vector3, Vector3)
public static Vector3 GroundDirection(Vector3 planeNormal, Vector3 sideDirection)
Parameters
planeNormal
Vector3
sideDirection
Vector3
Returns
- Vector3
IgnoreConnect(Rigidbody, Rigidbody)
public static void IgnoreConnect(Rigidbody rig1, Rigidbody rig2)
Parameters
rig1
Rigidbody
rig2
Rigidbody
InBoxRange(Vector3, Vector3, int)
public static bool InBoxRange(Vector3 position1, Vector3 position2, int range)
Parameters
position1
Vector3
position2
Vector3
range
int
Returns
- bool
public static GameObject InstantiatePrefab(GameObject sourceObj, Transform transform)
Parameters
sourceObj
GameObject
transform
Transform
Returns
- GameObject
IsMine(GameObject)
public static bool IsMine(GameObject target)
Parameters
target
GameObject
Returns
- bool
LineCheck(Vector3, Vector3, LayerType, float)
public static RaycastHit LineCheck(Vector3 from, Vector3 to, HelperFunctions.LayerType layerType, float radius = 0)
Parameters
from
Vector3
to
Vector3
layerType
HelperFunctions.LayerType
radius
float
Returns
- RaycastHit
LineCheckAll(Vector3, Vector3, LayerType, float)
public static RaycastHit[] LineCheckAll(Vector3 from, Vector3 to, HelperFunctions.LayerType layerType, float radius = 0)
Parameters
from
Vector3
to
Vector3
layerType
HelperFunctions.LayerType
radius
float
Returns
- RaycastHit[]
LinearBezier(Vector3, Vector3, float)
public static Vector3 LinearBezier(Vector3 start, Vector3 end, float _t)
Parameters
start
Vector3
end
Vector3
_t
float
Returns
- Vector3
LookToDirection(Vector3, Vector3)
public static Vector3 LookToDirection(Vector3 look, Vector3 targetDir)
Parameters
look
Vector3
targetDir
Vector3
Returns
- Vector3
LookToEuler(Vector2)
public static Vector3 LookToEuler(Vector2 lookRotationValues)
Parameters
lookRotationValues
Vector2
Returns
- Vector3
MultiplyVectors(Vector3, Vector3)
public static Vector3 MultiplyVectors(Vector3 v1, Vector3 v2)
Parameters
v1
Vector3
v2
Vector3
Returns
- Vector3
PhysicsRotateTowards(Rigidbody, Vector3, Vector3, float)
public static void PhysicsRotateTowards(Rigidbody rig, Vector3 from, Vector3 to, float force)
Parameters
rig
Rigidbody
from
Vector3
to
Vector3
force
float
QuadraticBezier(Vector3, Vector3, Vector3, float)
public static Vector3 QuadraticBezier(Vector3 start, Vector3 _P1, Vector3 end, float _t)
Parameters
start
Vector3
_P1
Vector3
end
Vector3
_t
float
Returns
- Vector3
RandomOnFlatCircle()
public static Vector3 RandomOnFlatCircle()
Returns
- Vector3
RaycastHitComparer(RaycastHit, RaycastHit)
public static int RaycastHitComparer(RaycastHit x, RaycastHit y)
Parameters
x
RaycastHit
y
RaycastHit
Returns
- int
SeparateClamps(Vector3, float)
public static Vector3 SeparateClamps(Vector3 rotationError, float clamp)
Parameters
rotationError
Vector3
clamp
float
Returns
- Vector3
public static void SetChildCollidersLayer(Transform root, int layerID)
Parameters
root
Transform
layerID
int
public static void SetChildRendererLayer(Transform root, int layerID)
Parameters
root
Transform
layerID
int
SetJointDrive(ConfigurableJoint, float, float, Rigidbody)
public static void SetJointDrive(ConfigurableJoint joint, float spring, float damper, Rigidbody rig)
Parameters
joint
ConfigurableJoint
spring
float
damper
float
rig
Rigidbody
SetRandomSeedFromWorldPos(Vector3, int)
public static Random.State SetRandomSeedFromWorldPos(Vector3 position, int seed)
Parameters
position
Vector3
seed
int
Returns
- Random.State
SortRaycastResults(RaycastHit[])
public static RaycastHit[] SortRaycastResults(RaycastHit[] hitsToSort)
Parameters
hitsToSort
RaycastHit[]
Returns
- RaycastHit[]
public static void SpawnPrefab(GameObject gameObject, Vector3 position, Quaternion rotation, Transform transform)
Parameters
gameObject
GameObject
position
Vector3
rotation
Quaternion
transform
Transform