public void Init(MenuData data, Action clickCb) { _menuData = data; _onClickHandler = clickCb; transform.Reset(); }
protected virtual void HelperConstruct(MenuData data, out MenuHelper helper) { helper = new MenuHelper(); helper.Data = data; helper.OnEnableCallback = _helper.OnEnableCallback; helper.OnMenuChangeHandler = OnSubMenuChange; helper.InteractType = _helper.InteractType; }
public void AddChild(int dataId) { if (ChildsMap == null) { ChildsMap = new Dictionary <int, MenuData>(); } if (!ChildsMap.ContainsKey(dataId)) { var child = new MenuData(dataId); ChildsMap.Add(dataId, child); } }