chore: fix compiler warnings

This commit is contained in:
bd_ 2024-09-27 19:24:19 -07:00
parent 7e5c227867
commit b866628b24
10 changed files with 16 additions and 16 deletions

View File

@ -18,7 +18,7 @@ namespace nadena.dev.modular_avatar.core.editor
{
return (EditorStyles.label?.lineHeight ?? 0) * 3;
}
catch (NullReferenceException e)
catch (NullReferenceException)
{
// This can happen in early initialization...
return 0;

View File

@ -3,7 +3,6 @@
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.UIElements;
#endregion
@ -148,7 +147,7 @@ namespace nadena.dev.modular_avatar.core.editor.ShapeChanger
{
return targetObject?.GetComponent<Renderer>()?.sharedMaterials;
}
catch (MissingComponentException e)
catch (MissingComponentException)
{
return null;
}

View File

@ -30,7 +30,7 @@ namespace nadena.dev.modular_avatar.core.editor
createInstaller = false;
}
}
catch (MissingComponentException e)
catch (MissingComponentException)
{
// ignore
}

View File

@ -64,7 +64,7 @@ namespace nadena.dev.modular_avatar.core.editor.ShapeChanger
.Select(x => mesh.GetBlendShapeName(x))
.ToList();
}
catch (MissingComponentException e)
catch (MissingComponentException)
{
shapeNames = null;
}

View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
#if MA_VRCSDK3_AVATARS
using VRC.SDK3.Dynamics.PhysBone.Components;
#endif
@ -123,7 +123,7 @@ namespace nadena.dev.modular_avatar.core.editor
}
}
}
catch (MissingComponentException _)
catch (MissingComponentException)
{
// No animator? weird. Move on.
}
@ -194,7 +194,7 @@ namespace nadena.dev.modular_avatar.core.editor
{
if (!referencedGameObjects.Contains(go))
{
UnityEngine.Object.DestroyImmediate(go);
Object.DestroyImmediate(go);
}
}
}

View File

@ -109,7 +109,7 @@ namespace nadena.dev.modular_avatar.core.editor
{
return uxml != null && EditorStyles.label != null;
}
catch (NullReferenceException _)
catch (NullReferenceException)
{
return false;
}

View File

@ -157,9 +157,7 @@ namespace nadena.dev.modular_avatar.core.editor
if (condition.ReferenceObject != null && !toggledObjects.Contains(condition.ReferenceObject))
condition.IsConstant = asc.AnimationDatabase.ClipsForPath(asc.PathMappings.GetObjectIdentifier(condition.ReferenceObject)).IsEmpty;
var i = 0;
// Remove redundant active conditions.
int retain = 0;
actionGroup.ControllingConditions.RemoveAll(c => c.IsConstant && c.InitiallyActive);
}

View File

@ -128,7 +128,7 @@ namespace nadena.dev.modular_avatar.core.editor
n_nrm[i] = o_nrm[newToOrigVertIndex[i]];
n_tan[i] = o_tan[newToOrigVertIndex[i]];
}
catch (IndexOutOfRangeException e)
catch (IndexOutOfRangeException)
{
throw;
}
@ -250,7 +250,6 @@ namespace nadena.dev.modular_avatar.core.editor
{
List<int> n2o = new List<int>(toRetainVertices.Length);
List<int> o2n = new List<int>(toRetainVertices.Length);
int i = 0;
for (int j = 0; j < toRetainVertices.Length; j++)
{

View File

@ -385,8 +385,6 @@ namespace nadena.dev.modular_avatar.core.editor
private static bool ValidateSetupOutfit(GameObject gameObj)
{
Object obj;
if (gameObj == null)
{
errorHeader = S("setup_outfit.err.header.notarget");

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using nadena.dev.ndmf;
using NUnit.Framework;
@ -28,6 +29,11 @@ namespace modular_avatar_tests
return transformMaskElements.SequenceEqual(other.transformMaskElements);
}
public override int GetHashCode()
{
return HashCode.Combine(humanoidMaskElements, transformMaskElements);
}
public static ExtractedMask FromAvatarMask(AvatarMask mask)
{
var so = new SerializedObject(mask);