mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-25 22:08:59 +08:00
parent
d385eb8800
commit
d940e5de8a
@ -175,25 +175,40 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
_needsRebuild = true;
|
_needsRebuild = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float ElementHeight(int index)
|
// https://github.com/bdunderscore/modular-avatar/issues/217
|
||||||
|
private float[] ElementHeightCache = null;
|
||||||
|
|
||||||
|
private float[] BuildHeightCache()
|
||||||
{
|
{
|
||||||
float baseHeight = _devMode ? elemHeight * 2 : elemHeight;
|
float[] cache = new float[_selectedIndices.Count];
|
||||||
|
|
||||||
var param = GetParamByIndex(_selectedIndices[index]);
|
for (int i = 0; i < _selectedIndices.Count; i++)
|
||||||
var syncMode = param.FindPropertyRelative(nameof(ParameterConfig.syncType));
|
|
||||||
if (syncMode.enumValueIndex != (int) ParameterSyncType.NotSynced)
|
|
||||||
{
|
{
|
||||||
baseHeight += elemHeight;
|
float baseHeight = _devMode ? elemHeight * 2 : elemHeight;
|
||||||
|
|
||||||
|
var param = GetParamByIndex(_selectedIndices[i]);
|
||||||
|
var syncMode = param.FindPropertyRelative(nameof(ParameterConfig.syncType));
|
||||||
|
if (syncMode.enumValueIndex != (int) ParameterSyncType.NotSynced)
|
||||||
|
{
|
||||||
|
baseHeight += elemHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_selectedIndices[i] == -1)
|
||||||
|
{
|
||||||
|
cache[i] = elemHeight + baseHeight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cache[i] = baseHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_selectedIndices[index] == -1)
|
return cache;
|
||||||
{
|
}
|
||||||
return elemHeight + baseHeight;
|
|
||||||
}
|
private float ElementHeight(int reqIndex)
|
||||||
else
|
{
|
||||||
{
|
return ElementHeightCache[reqIndex];
|
||||||
return baseHeight;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawAutodetectHeader(ref Rect rect)
|
private void DrawAutodetectHeader(ref Rect rect)
|
||||||
@ -412,6 +427,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
protected override void OnInnerInspectorGUI()
|
protected override void OnInnerInspectorGUI()
|
||||||
{
|
{
|
||||||
|
ElementHeightCache = BuildHeightCache();
|
||||||
|
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
_devMode = EditorGUILayout.Toggle(G("params.devmode"), _devMode);
|
_devMode = EditorGUILayout.Toggle(G("params.devmode"), _devMode);
|
||||||
if (EditorGUI.EndChangeCheck() || _reorderableList == null || _needsRebuild) SetupList();
|
if (EditorGUI.EndChangeCheck() || _reorderableList == null || _needsRebuild) SetupList();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user