Skip to content

Commit

Permalink
chore: remove merged property which is nonsense
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Apr 20, 2023
1 parent 05fbf94 commit 8846c93
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
6 changes: 0 additions & 6 deletions Editor/MergePhysBoneEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ private static class Style
};
}

private SerializedProperty _mergedComponentProp;
private SerializedProperty _makeParent;
private SerializedProperty _forcesProp;
private SerializedProperty _pullProp;
Expand Down Expand Up @@ -55,7 +54,6 @@ private static class Style
private void OnEnable()
{
var nestCount = PrefabSafeSet.PrefabSafeSetUtil.PrefabNestCount(serializedObject.targetObject);
_mergedComponentProp = serializedObject.FindProperty("merged");
_makeParent = serializedObject.FindProperty("makeParent");
_forcesProp = serializedObject.FindProperty("forces");
_pullProp = serializedObject.FindProperty("pull");
Expand Down Expand Up @@ -86,10 +84,6 @@ private void OnEnable()

protected override void OnInspectorGUIInner()
{
EditorGUI.BeginDisabledGroup(_mergedComponentProp.objectReferenceValue != null);
EditorGUILayout.PropertyField(_mergedComponentProp);
EditorGUI.EndDisabledGroup();

EditorGUILayout.PropertyField(_makeParent);
if (_makeParent.boolValue && ((Component)target).transform.childCount != 0)
EditorGUILayout.HelpBox(CL4EE.Tr("MergePhysBone:error:makeParentWithChildren"), MessageType.Error);
Expand Down
3 changes: 2 additions & 1 deletion Editor/Processors/MergePhysBoneProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using UnityEditor;
using UnityEngine;
using VRC.Dynamics;
using VRC.SDK3.Dynamics.PhysBone.Components;
using Object = UnityEngine.Object;

namespace Anatawa12.AvatarOptimizer.Processors
Expand Down Expand Up @@ -69,7 +70,7 @@ internal static void DoMerge(MergePhysBone merge, OptimizerSession session)
$"property differ: {string.Join(", ", differProps)}");

var pb = sourceComponents[0];
var merged = merge.merged;
var merged = merge.GetComponent<VRCPhysBone>();

// optimization: if All children of the parent is to be merged,
// reuse that parent GameObject instead of creating new one.
Expand Down
10 changes: 0 additions & 10 deletions Runtime/MergePhysBone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ namespace Anatawa12.AvatarOptimizer
[ExecuteAlways]
internal class MergePhysBone : AvatarTagComponent
{
[FormerlySerializedAs("mergedComponent")]
[CL4EELocalized("MergePhysBone:prop:merged")]
public VRCPhysBoneBase merged;

[Obsolete("v2 legacy", true)]
public Transform rootTransform;

Expand Down Expand Up @@ -81,12 +77,6 @@ public MergePhysBone()
{
componentsSet = new PrefabSafeSet.VRCPhysBoneBaseSet(this);
}

void OnEnable()
{
if (merged == null)
merged = GetComponent<VRCPhysBoneBase>();
}
}

public enum CollidersSettings
Expand Down

0 comments on commit 8846c93

Please sign in to comment.