NodeInspector.Editor.GraphData.RemoveElementFromList C# (CSharp) Method

RemoveElementFromList() public method

public RemoveElementFromList ( ScriptableObject listItem ) : void
listItem UnityEngine.ScriptableObject
return void
        public void RemoveElementFromList(ScriptableObject listItem)
        {
            for (int index = 0; index < ItemList.Count; index++) {
                if (ItemList[index] == listItem){
                    SerializedItemList.GetArrayElementAtIndex(index).objectReferenceValue = null;
                    SerializedItemList.DeleteArrayElementAtIndex(index);
                    SerializedItemList.serializedObject.ApplyModifiedProperties();
                    break;
                }
            }

            if (StartNode != null
                && StartNode.objectReferenceValue == listItem){
                StartNode.objectReferenceValue = null;
                StartNode.serializedObject.ApplyModifiedProperties();
            }

            //FIXME: unfortunatly we can't remove this subasset from main asset because we will lost
            //        this object and won't be able to Undo this action. Try to fix that later and clean junk on some events like window close.
        }