mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 19:39:21 +00:00
Reset button, animation cancel, world check, VR offset fix
This commit is contained in:
parent
8ffc876376
commit
8bee0d2adf
5 changed files with 128 additions and 18 deletions
|
@ -1,13 +1,22 @@
|
|||
using UnityEngine;
|
||||
using ABI.CCK.Components;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ml_prm
|
||||
{
|
||||
static class Utils
|
||||
{
|
||||
public static bool IsInVR() => ((ABI_RC.Core.Savior.CheckVR.Instance != null) && ABI_RC.Core.Savior.CheckVR.Instance.hasVrDeviceLoaded);
|
||||
public static bool IsWorldSafe() => ((CVRWorld.Instance != null) && CVRWorld.Instance.allowFlying && CVRWorld.Instance.allowSpawnables);
|
||||
|
||||
public static void CopyGlobal(this Transform p_source, Transform p_target)
|
||||
{
|
||||
p_target.position = p_source.position;
|
||||
p_target.rotation = p_source.rotation;
|
||||
}
|
||||
|
||||
public static Matrix4x4 GetMatrix(this Transform p_transform, bool p_pos = true, bool p_rot = true, bool p_scl = false)
|
||||
{
|
||||
return Matrix4x4.TRS(p_pos ? p_transform.position : Vector3.zero, p_rot ? p_transform.rotation : Quaternion.identity, p_scl ? p_transform.localScale : Vector3.one);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue