示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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;
            }
        }
示例#4
0
 public void OpenTools(PageModel.Page _page)
 {
     uiBlockly.pageTools.gameObject.SetActive(true);
     uiBlockly.inputPageName.text = _page.profile.name;
     uiBlockly.tgRunAwake.isOn    = _page.profile.runAwake;
 }
示例#5
0
 public void ActivatePage(PageModel.Page _page)
 {
     activePage = _page.uuid;
     uiBlockly.pageTools.gameObject.SetActive(false);
 }
示例#6
0
 public void RefreshPage(PageModel.Page _page)
 {
     refreshPage(_page);
 }
示例#7
0
 public void RefreshDeletePage(PageModel.Page _page)
 {
     removePage(_page);
 }
示例#8
0
 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);
 }