diff --git a/Assets/HhotateA/AvatarModifyTool/Editor/AvatarModifyTool.cs b/Assets/HhotateA/AvatarModifyTool/Editor/AvatarModifyTool.cs index 688253c..350d169 100644 --- a/Assets/HhotateA/AvatarModifyTool/Editor/AvatarModifyTool.cs +++ b/Assets/HhotateA/AvatarModifyTool/Editor/AvatarModifyTool.cs @@ -449,6 +449,11 @@ void SetAvatarAnimatorController(AnimatorLayerType type, AnimatorController cont avatar.customizeAnimationLayers = true; var index = Array.FindIndex(avatar.baseAnimationLayers, l => l.type == type.GetVRChatAnimatorLayerType()); + if (index == -1) + { + Debug.LogError("Animation Layers" + type.GetVRChatAnimatorLayerType() + " Not Found"); + return; + } avatar.baseAnimationLayers[index].isDefault = false; avatar.baseAnimationLayers[index].animatorController = controller; #else @@ -461,6 +466,11 @@ bool GetAvatarAnimatorControllerExists(AnimatorLayerType type) #if VRC_SDK_VRCSDK3 var index = Array.FindIndex(avatar.baseAnimationLayers, l => l.type == type.GetVRChatAnimatorLayerType()); + if (index == -1) + { + Debug.LogError("Animation Layers" + type.GetVRChatAnimatorLayerType() + " Not Found"); + return false; + } return avatar.baseAnimationLayers[index].animatorController != null; #else return avatar.runtimeAnimatorController != null; @@ -540,6 +550,11 @@ Dictionary ComputeLayersOffset(AvatarModifyData assets) int GetLayerOffset(AvatarModifyData assets,AnimatorLayerType type) { var index = Array.FindIndex(avatar.baseAnimationLayers,l => l.type == type.GetVRChatAnimatorLayerType()); + if (index == -1) + { + Debug.LogError("Animation Layers" + type.GetVRChatAnimatorLayerType() + " Not Found"); + return 0; + } if (avatar.customizeAnimationLayers == false) return 0; if (avatar.baseAnimationLayers[index].isDefault == true) return 0; if (!avatar.baseAnimationLayers[index].animatorController) return 0; diff --git a/Assets/HhotateA/MagicalDresserInventorySystem/Editor/MagicalDresserInventorySetup.cs b/Assets/HhotateA/MagicalDresserInventorySystem/Editor/MagicalDresserInventorySetup.cs index a2bf8a7..dd7e1d5 100644 --- a/Assets/HhotateA/MagicalDresserInventorySystem/Editor/MagicalDresserInventorySetup.cs +++ b/Assets/HhotateA/MagicalDresserInventorySystem/Editor/MagicalDresserInventorySetup.cs @@ -2389,7 +2389,12 @@ Material GetDefaultMaterial(Renderer rend, int index) defaultMaterials.Add(rend,rend.sharedMaterials.ToArray()); } - return defaultMaterials[rend][index]; + if ( 0 <= index && index < defaultMaterials[rend].Length) + { + return defaultMaterials[rend][index]; + } + + return null; } // デフォルトのBlendShape状態(シーン)を記録&取得する