Skip to content

Commit

Permalink
fix: when pressing the "add" button in the Tweener inspector, an erro…
Browse files Browse the repository at this point in the history
…r occurs.
  • Loading branch information
mob-sakai committed Sep 29, 2024
1 parent a6d57d2 commit c661bcd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Packages/src/Editor/InjectionPropertyListDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ private void OnAddDropdownCallback(Rect r, ReorderableList _)
if (!current) return;

var included = new HashSet<string>(Enumerable.Range(0, propArray.arraySize)
.Select(i => propArray.GetArrayElementAtIndex(i).FindPropertyRelative("m_PropertyName").stringValue));
.Select(i =>
{
var ps = propArray.GetArrayElementAtIndex(i);
var propName = ps.type == "InjectionPropertyPair" ? "m_From.m_PropertyName" : "m_PropertyName";
return ps.FindPropertyRelative(propName).stringValue;
}));
var shader = current.defaultMaterialForRendering.shader;
var properties = shader.GetAllProperties()
.Where(p => !included.Contains(p.name))
Expand Down

0 comments on commit c661bcd

Please sign in to comment.