public override bool Remove(IUIBaseObject element) { var res = base.Remove(element); if (res) { ((StatBaseModifierTemplateUI)element).FunctionChanged -= StatBaseModifierListUI_FunctionChanged; } return(res); }
public virtual bool Add(IUIBaseObject element) { if (_elements.Add(element)) { element.DeleteRequested += Item_DeleteRequested; element.Selected += Element_Selected; SceneDataManager.instance.Add(element.BaseObject); return(true); } return(false); }
public virtual bool Remove(IUIBaseObject element) { if (_elements.Remove(element)) { element.DeleteRequested -= Item_DeleteRequested; SceneDataManager.instance.Remove(element.Id); Destroy(element.gameObject); return(true); } return(false); }
private void Start() { AddButton.Clicked += AddButton_Clicked; SaveButton.Clicked += SaveButton_Clicked; LoadButton.Clicked += LoadButton_Clicked; FilterInput.ValueChanged += FilterInput_ValueChanged; _prefab = Prefab.GetComponent <IUIBaseObject>(); _prefab.CreateNewObject(); _objectType = _prefab.BaseObject.Type; }
public bool Equals(IUIBaseObject other) { return(other != null && other.GetHashCode() == GetHashCode()); }
protected virtual void Element_Selected(object sender) { SelectedElement = sender as IUIBaseObject; }