Пример #1
0
 public override void RemoveAdapters()
 {
     for (int i = 0; i < contentPanelTransform.transform.childCount; i++)
     {
         SmartItemActionEventAdapter toRemove = contentPanelTransform.transform.GetChild(i).gameObject.GetComponent <SmartItemActionEventAdapter>();
         Destroy(toRemove.gameObject);
     }
 }
Пример #2
0
    public override void AddAdapters()
    {
        base.AddAdapters();

        foreach (SmartItemActionEvent actionEvent in contentList)
        {
            SmartItemActionEventAdapter adapter = Instantiate(this.adapter, contentPanelTransform).GetComponent <SmartItemActionEventAdapter>();
            adapter.SetContent(actionEvent);
        }
    }
 private void RemoveActionable(SmartItemActionEventAdapter actionable)
 {
     contentList.Remove(actionable.GetContent());
     OnActionableRemove?.Invoke(actionable.GetContent().smartItemActionable);
     RemoveAdapter(actionable);
 }
 private void RemoveAdapter(SmartItemActionEventAdapter adapter)
 {
     adapter.OnActionableRemove -= RemoveActionable;
     Destroy(adapter.gameObject);
 }