private void RemoveReferenceBinder(int regIndex) { DataBinderLink registrar = m_databinder.AllBinderLinks[regIndex]; List <BinderComponent> newList = new List <BinderComponent>(); foreach (BinderComponent binder in m_databinder.AllBinderLinks[regIndex].ConnectedBinderComponents) { if (!(binder is ReferenceDataBinderComponent)) { newList.Add(binder); } } RemoveAttachedReferenceBinders(regIndex); m_databinder.AllBinderLinks[regIndex].ConnectedBinderComponents = newList.ToArray(); }
public override void OnInspectorGUI() { serializedObject.Update(); GUILayout.Space(5); EditorGUILayout.PropertyField(m_idProperty); GUILayout.Space(5); DisplayBinderLink(); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Add New Data Binder Link", GUILayout.Width(200), GUILayout.Height(30))) { DataBinderLink newBinderLink = CreateBinderLink(); m_binderLinksProperty.AddToObjectArray(newBinderLink); } EditorGUILayout.EndHorizontal(); GUILayout.Space(5); serializedObject.ApplyModifiedProperties(); }
private DataBinderLink CreateBinderLink() { DataBinderLink newInstance = m_databinder.gameObject.AddComponent <DataBinderLink>(); return(newInstance); }