Skip to content

Commit

Permalink
Merge pull request #74 from Delt06/dev
Browse files Browse the repository at this point in the history
Minor improvements (v2.6.2)
  • Loading branch information
Delt06 committed Feb 11, 2022
2 parents c58f0b9 + 8d198b7 commit b706c3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Expand Up @@ -69,7 +69,11 @@ private void DrawList(SerializedObject container, SerializedProperty list)
if (index == list.arraySize - 1)
EditorGUI.EndDisabledGroup();

if (MiniButton("+")) list.InsertArrayElementAtIndex(index);
if (MiniButton("+"))
{
list.InsertArrayElementAtIndex(index);
list.GetArrayElementAtIndex(index + 1).objectReferenceValue = null;
}

if (MiniButton("-")) DeleteArrayElementAtIndex(list, index);

Expand All @@ -85,12 +89,10 @@ private void DrawList(SerializedObject container, SerializedProperty list)
if (selectedIndex != 0)
{
var listDependencyContainer = (ListDependencyContainer) container.targetObject;
listDependencyContainer.Add(components[selectedIndex - 1]);
list.GetArrayElementAtIndex(index).objectReferenceValue = components[selectedIndex - 1];
container.ApplyModifiedProperties();
container.Update();
EditorUtility.SetDirty(listDependencyContainer);

list.DeleteArrayElementAtIndex(index);
list.DeleteArrayElementAtIndex(index);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Packages/com.deltation.di-framework/package.json
@@ -1,6 +1,6 @@
{
"name": "com.deltation.di-framework",
"version": "2.6.1",
"version": "2.6.2",
"displayName": "DI Framework",
"description": "A simple Unity DI/IoC framework to inject dependencies into your components.",
"unity": "2020.3",
Expand Down

0 comments on commit b706c3c

Please sign in to comment.