mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2025-07-18 17:38:01 +08:00
Fixed enabled in BonesPanel, refactored SetMeshesEnabled to not use reflection and to disable meshes consistently with the BonesManager.
This commit is contained in:
@ -145,13 +145,12 @@ namespace UnityExplorer.UI.Panels
|
||||
}
|
||||
|
||||
public void SetMeshesEnabled(bool value){
|
||||
PropertyInfo enabledProperty = typeof(SkinnedMeshRenderer).GetProperty("enabled");
|
||||
foreach (SkinnedMeshRenderer skinnedMesh in skinnedMeshes) {
|
||||
enabledProperty.SetValue(skinnedMesh, value, null);
|
||||
skinnedMesh.TryCast<Renderer>().enabled = value;
|
||||
}
|
||||
|
||||
foreach (MeshRenderer meshRenderer in extraMeshes) {
|
||||
meshRenderer.enabled = value;
|
||||
meshRenderer.gameObject.SetActive(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ namespace UnityExplorer.UI.Panels
|
||||
bone.localEulerAngles = CachedBonesTransform.angles;
|
||||
bone.localScale = CachedBonesTransform.scale;
|
||||
// We assume these were on before. If not we should save its state beforehand.
|
||||
bone.gameObject.SetEnabled(true);
|
||||
bone.gameObject.SetActive(true);
|
||||
}
|
||||
} else {
|
||||
bonesOriginalState.Clear();
|
||||
|
Reference in New Issue
Block a user