Minor cleanup

This commit is contained in:
SDraw 2023-12-25 02:02:45 +03:00
parent 6a671d0da6
commit 9e841cef1c
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
15 changed files with 142 additions and 171 deletions

View file

@ -2,7 +2,6 @@
using ABI_RC.Core.UI;
using ABI_RC.Systems.MovementSystem;
using RootMotion.FinalIK;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;

View file

@ -1,6 +1,5 @@
using ABI_RC.Core.UI;
using System.Reflection;
using UnityEngine;
namespace ml_asl
{

View file

@ -13,8 +13,8 @@ namespace ml_lme
"leapmotion_hands.asset"
};
static Dictionary<string, AssetBundle> ms_loadedAssets = new Dictionary<string, AssetBundle>();
static Dictionary<string, GameObject> ms_loadedObjects = new Dictionary<string, GameObject>();
static readonly Dictionary<string, AssetBundle> ms_loadedAssets = new Dictionary<string, AssetBundle>();
static readonly Dictionary<string, GameObject> ms_loadedObjects = new Dictionary<string, GameObject>();
public static void Load()
{

View file

@ -283,7 +283,7 @@ namespace ml_lme
{
float l_strength = l_data.m_leftHand.m_grabStrength;
float l_interactValue = 0f;
float l_interactValue;
if(m_gripToGrab)
l_interactValue = Mathf.Clamp01(Mathf.InverseLerp(Mathf.Min(Settings.GripThreadhold, Settings.InteractThreadhold), Mathf.Max(Settings.GripThreadhold, Settings.InteractThreadhold), l_strength));
else
@ -311,7 +311,7 @@ namespace ml_lme
{
float l_strength = l_data.m_rightHand.m_grabStrength;
float l_interactValue = 0f;
float l_interactValue;
if(m_gripToGrab)
l_interactValue = Mathf.Clamp01(Mathf.InverseLerp(Mathf.Min(Settings.GripThreadhold, Settings.InteractThreadhold), Mathf.Max(Settings.GripThreadhold, Settings.InteractThreadhold), l_strength));
else

View file

@ -1,5 +1,4 @@
using ABI_RC.Core.Player;
using ABI_RC.Systems.IK.SubSystems;
using System.Collections;
using System.Reflection;
using UnityEngine;

View file

@ -1,9 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ml_lme
{

View file

@ -4,17 +4,14 @@ namespace ml_lme
{
class VisualHand
{
Transform m_root = null;
Transform m_wrist = null;
Transform[] m_fingers = null;
readonly Transform m_wrist = null;
readonly Transform[] m_fingers = null;
public VisualHand(Transform p_root, bool p_left)
{
m_root = p_root;
if(m_root != null)
if(p_root != null)
{
m_wrist = m_root.Find(p_left ? "LeftHand/Wrist" : "RightHand/Wrist");
m_wrist = p_root.Find(p_left ? "LeftHand/Wrist" : "RightHand/Wrist");
if(m_wrist != null)
{
m_fingers = new Transform[20];

View file

@ -59,12 +59,7 @@ namespace ml_pin
l_notify |= (Settings.FriendsAlways && l_isFriend);
if(l_notify)
{
if(l_isFriend)
m_soundManager?.PlaySound(SoundManager.SoundType.FriendJoin);
else
m_soundManager?.PlaySound(SoundManager.SoundType.PlayerJoin);
}
m_soundManager?.PlaySound(l_isFriend ? SoundManager.SoundType.FriendJoin : SoundManager.SoundType.PlayerJoin);
}
catch(Exception e)
{
@ -93,12 +88,7 @@ namespace ml_pin
l_notify |= (Settings.FriendsAlways && l_isFriend);
if(l_notify)
{
if(l_isFriend)
m_soundManager?.PlaySound(SoundManager.SoundType.FriendLeave);
else
m_soundManager?.PlaySound(SoundManager.SoundType.PlayerLeave);
}
m_soundManager?.PlaySound(l_isFriend ? SoundManager.SoundType.FriendLeave : SoundManager.SoundType.PlayerLeave);
}
catch(Exception e)
{
@ -108,9 +98,9 @@ namespace ml_pin
bool ShouldNotifyInCurrentInstance()
{
bool l_isInPublic = Settings.NotifyInPublic && MetaPort.Instance.CurrentInstancePrivacy.Contains("Public");
bool l_isInFriends = Settings.NotifyInFriends && MetaPort.Instance.CurrentInstancePrivacy.Contains("Friends");
bool l_isInPrivate = Settings.NotifyInPrivate && MetaPort.Instance.CurrentInstancePrivacy.Contains("invite");
bool l_isInPublic = (Settings.NotifyInPublic && MetaPort.Instance.CurrentInstancePrivacy.Contains("Public"));
bool l_isInFriends = (Settings.NotifyInFriends && MetaPort.Instance.CurrentInstancePrivacy.Contains("Friends"));
bool l_isInPrivate = (Settings.NotifyInPrivate && MetaPort.Instance.CurrentInstancePrivacy.Contains("invite"));
return (l_isInPublic || l_isInFriends || l_isInPrivate);
}
}

View file

@ -1,5 +1,4 @@
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using ABI_RC.Systems.IK;
using ABI_RC.Systems.IK.SubSystems;
using ABI_RC.Systems.InputManagement;
@ -81,8 +80,8 @@ namespace ml_pmc
CVRInputManager.Instance.individualFingerTracking = true;
IKSystem.Instance.FingerSystem.controlActive = true;
ref float[] l_curls = ref m_puppetParser.GetFingerCurls();
ref float[] l_spreads = ref m_puppetParser.GetFingerSpreads();
ref readonly float[] l_curls = ref m_puppetParser.GetFingerCurls();
ref readonly float[] l_spreads = ref m_puppetParser.GetFingerSpreads();
CVRInputManager.Instance.fingerCurlLeftThumb = l_curls[l_mirror ? 5 : 0];
CVRInputManager.Instance.fingerCurlLeftIndex = l_curls[l_mirror ? 6 : 1];

View file

@ -20,8 +20,8 @@ namespace ml_pmc
float m_leftGesture = 0f;
float m_rightGesture = 0f;
bool m_fingerTracking = false;
float[] m_fingerCurls = null;
float[] m_fingerSpreads = null;
readonly float[] m_fingerCurls = null;
readonly float[] m_fingerSpreads = null;
internal PuppetParser()
{
@ -102,7 +102,7 @@ namespace ml_pmc
public float GetLeftGesture() => m_leftGesture;
public float GetRightGesture() => m_rightGesture;
public bool HasFingerTracking() => m_fingerTracking;
public ref float[] GetFingerCurls() => ref m_fingerCurls;
public ref float[] GetFingerSpreads() => ref m_fingerSpreads;
public ref readonly float[] GetFingerCurls() => ref m_fingerCurls;
public ref readonly float[] GetFingerSpreads() => ref m_fingerSpreads;
}
}

View file

@ -1,9 +1,6 @@
using ABI.CCK.Components;
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using ABI_RC.Systems.InputManagement;
using System.Linq;
using System.Reflection;
using UnityEngine;
namespace ml_pmc

View file

@ -1,7 +1,6 @@
using ABI.CCK.Components;
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using ABI_RC.Systems.Camera;
using ABI_RC.Systems.IK;
using ABI_RC.Systems.IK.SubSystems;
@ -22,7 +21,6 @@ namespace ml_prm
public static RagdollController Instance { get; private set; } = null;
bool m_inVr = false;
VRIK m_vrIK = null;
bool m_applyHipsPosition = false;
bool m_applyHipsRotation = false;
@ -69,8 +67,6 @@ namespace ml_prm
if(Instance == null)
Instance = this;
m_inVr = Utils.IsInVR();
m_physicsMaterial = new PhysicMaterial("Ragdoll");
m_physicsMaterial.dynamicFriction = c_defaultFriction;
m_physicsMaterial.staticFriction = c_defaultFriction;
@ -241,8 +237,6 @@ namespace ml_prm
internal void OnAvatarSetup()
{
m_inVr = Utils.IsInVR();
if(PlayerSetup.Instance._animator.isHuman)
{
BipedRagdollReferences l_avatarReferences = BipedRagdollReferences.FromAvatar(PlayerSetup.Instance._animator);

View file

@ -88,7 +88,8 @@ namespace ml_vei
{
GripTrigger = bool.Parse(p_value);
GripTriggerChange?.Invoke(GripTrigger);
} break;
}
break;
}
ms_entries[(int)l_setting].BoxedValue = bool.Parse(p_value);