diff --git a/src/Cinematic/Cells/AnimatorCell.cs b/src/Cinematic/Cells/AnimatorCell.cs index ab30e0e..b15382f 100644 --- a/src/Cinematic/Cells/AnimatorCell.cs +++ b/src/Cinematic/Cells/AnimatorCell.cs @@ -43,6 +43,7 @@ namespace UnityExplorer.UI.Panels inspectButton.ButtonText.text = animatorPlayer.animator.name; IgnoreMasterToggle.isOn = animatorPlayer.shouldIgnoreMasterToggle; animatorToggler.isOn = animatorPlayer.animator.speed != 0; + MeshToggle.isOn = animatorPlayer.IsMeshHidden(); UpdateDropdownOptions(); } diff --git a/src/Cinematic/Cells/AnimatorPlayer.cs b/src/Cinematic/Cells/AnimatorPlayer.cs index 8b330cc..7adf2ba 100644 --- a/src/Cinematic/Cells/AnimatorPlayer.cs +++ b/src/Cinematic/Cells/AnimatorPlayer.cs @@ -153,6 +153,11 @@ namespace UnityExplorer.UI.Panels meshRenderer.gameObject.SetActive(value); } } + + public bool IsMeshHidden(){ + // Could maybe save a variable to set on SetMeshesEnabled instead + return skinnedMeshes.Any( m => m.TryCast().enabled) || extraMeshes.Any( m => m.gameObject.activeSelf); + } } public class IAnimator