mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-06-02 22:14:30 -05:00
EditorUtility.SaveFilePanel may expire some SerializedProperty variable. Fix for Unity-2021(This problem is not caused in Unity-2019.4)
#1449
This commit is contained in:
parent
728a9256e5
commit
27d6d65539
|
|
@ -76,27 +76,27 @@ namespace VRM
|
|||
|
||||
m_clipList.onAddCallback += (list) =>
|
||||
{
|
||||
// Add slot
|
||||
prop.arraySize++;
|
||||
// select last item
|
||||
list.index = prop.arraySize - 1;
|
||||
// get last item
|
||||
var element = prop.GetArrayElementAtIndex(list.index);
|
||||
element.objectReferenceValue = null;
|
||||
|
||||
// OpenFile dialog, create new BlendShapeClip
|
||||
var dir = Path.GetDirectoryName(AssetDatabase.GetAssetPath(target));
|
||||
var path = EditorUtility.SaveFilePanel(
|
||||
"Create BlendShapeClip",
|
||||
dir,
|
||||
string.Format("BlendShapeClip#{0}.asset", list.count),
|
||||
"asset");
|
||||
BlendShapeClip clip = null;
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
var clip = BlendShapeAvatar.CreateBlendShapeClip(path.ToUnityRelativePath());
|
||||
clip = BlendShapeAvatar.CreateBlendShapeClip(path.ToUnityRelativePath());
|
||||
//clip.Prefab = AssetDatabase.LoadAssetAtPath<GameObject>(AssetDatabase.GetAssetPath(target));
|
||||
|
||||
element.objectReferenceValue = clip;
|
||||
}
|
||||
|
||||
// Add slot
|
||||
prop.arraySize++;
|
||||
// select last item
|
||||
list.index = prop.arraySize - 1;
|
||||
// get last item
|
||||
var element = prop.GetArrayElementAtIndex(list.index);
|
||||
element.objectReferenceValue = clip;
|
||||
};
|
||||
|
||||
m_clipList.onSelectCallback += (list) =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user