private void removePage(PageModel.Page _page) { if (null == _page) { return; } Transform target = uiBlockly.tsTempaltePage.parent.Find(_page.uuid); if (null == target) { return; } GameObject.Destroy(target.gameObject); }
private void addPage(PageModel.Page _page) { if (null == _page) { return; } GameObject clone = GameObject.Instantiate(uiBlockly.tsTempaltePage.gameObject); clone.transform.SetParent(uiBlockly.tsTempaltePage.parent); clone.transform.localScale = Vector3.one; clone.name = _page.uuid; clone.SetActive(true); Button btnMore = clone.transform.Find("btnMore").GetComponent <Button>(); btnMore.onClick.AddListener(() => { model.UpdateOpenPageTools(clone.name); }); btnMore.gameObject.SetActive(false); Toggle toggle = clone.GetComponent <Toggle>(); toggle.onValueChanged.AddListener((_toggled) => { btnMore.gameObject.SetActive(_toggled); if (!_toggled) { return; } model.UpdateActivePage(clone.name); }); refreshPage(_page); }
private void refreshPage(PageModel.Page _page) { if (null == _page) { return; } Transform target = uiBlockly.tsTempaltePage.parent.Find(_page.uuid); if (null == target) { return; } UnityEngine.UI.Text name = target.Find("txtName").GetComponent <UnityEngine.UI.Text>(); if (string.IsNullOrEmpty(_page.profile.name)) { name.text = uiBlockly.blankPageName; } else { name.text = _page.profile.name; } }
public void OpenTools(PageModel.Page _page) { uiBlockly.pageTools.gameObject.SetActive(true); uiBlockly.inputPageName.text = _page.profile.name; uiBlockly.tgRunAwake.isOn = _page.profile.runAwake; }
public void ActivatePage(PageModel.Page _page) { activePage = _page.uuid; uiBlockly.pageTools.gameObject.SetActive(false); }
public void RefreshPage(PageModel.Page _page) { refreshPage(_page); }
public void RefreshDeletePage(PageModel.Page _page) { removePage(_page); }
public void RefreshNewPage(PageModel.Page _page) { addPage(_page); }
public void ActivatePage(PageModel.PageStatus _status, PageModel.Page _page) { view.ActivatePage(_page); controllerWorkbench.AddUnits(_status, _page.units); }
public void OpenTools(PageModel.Page _page) { view.OpenTools(_page); }
public void RefreshDeletePage(PageModel.Page _page) { view.RefreshDeletePage(_page); controllerWorkbench.Clean(); }
public void RefreshNewPage(PageModel.Page _page) { view.RefreshNewPage(_page); }