public override bool Init(UWarGoodsStoreView _viewParent) { //if (GoodsLabelDesList == null) // GoodsLabelDesList = GetTransform.FindChild("GoodsLabelFrame").GetComponent<UWarGoodsLabelDesList>(); if (AllGoodsTile == null) { AllGoodsTile = GetTransform.FindChild("AllGoodsFrame").GetComponent <UWarGoodsStoreAllGoodsTile>(); } if (AllGoodsTile2 == null) { AllGoodsTile2 = GetTransform.FindChild("AllGoodsTile2").GetComponent <UWarGoodsStoreAllGoodsTile>(); } if (GoodsLabelDesTree == null) { GoodsLabelDesTree = GetTransform.FindChild("GoodsLabelFrame").GetComponent <UWarGoodsStoreTreeView>(); if (GoodsLabelDesTree != null) { GoodsLabelDesTree.Start(); } } GoodsLabelDesTree.Multiple = false; GoodsLabelDesTree.KeepSelection = false; //GoodsLabelDesList.Multiple = false; return(base.Init(_viewParent)); }
protected void GetComponetBindAction(UIBehaviour _comp, string _strComName, EToolbar?_eToolbarType, UnityAction _action = null, UnityAction <string> _strAction = null) { if (_comp == null) { Transform _compTrans = GetTransform.FindChild(_strComName); if (_compTrans != null) { _comp = _compTrans.GetComponent <UIBehaviour>(); } } if (_comp != null) { if (_comp is Button) { (_comp as Button).onClick.AddListener(_action); } else if (_comp is InputField) { (_comp as InputField).onEndEdit.AddListener(_strAction); } if (_eToolbarType != null) { m_ToolbarItems.Add((EToolbar)_eToolbarType, _comp); } } }
public virtual void InitPrefabLinks() { if (WebBrowser == null) { Transform widgetTrans = GetTransform.FindChild("IWebBrowserWidget"); if (widgetTrans != null) { WebBrowser = widgetTrans.GetComponent <IWebBrowserWidget>(); if (WebBrowser == null) { Trace.LogWarning("没有找到 IwebBrowserWidget 组件。"); } } } if (WebBrowserDialog == null) { Transform widgetTrans = GetTransform.FindChild("WebBrowserDialog"); if (widgetTrans != null) { WebBrowserDialog = widgetTrans.GetComponent <UWebBrowserDialogWidget>(); if (WebBrowserDialog == null) { Trace.LogWarning("没有找到 UWebBrowserDialogWidget 组件。"); } } } WebBrowserDialog.InitBrowser(this); if (WebBrowserToolbar == null) { Transform widgetTrans = GetTransform.FindChild("WebBrowserToolbar"); if (widgetTrans != null) { WebBrowserToolbar = widgetTrans.GetComponent <UWebBrowserToolbarWidget>(); if (WebBrowserToolbar == null) { Trace.LogWarning("没有找到 UWebBrowserToolbarWidget 组件。"); } } } WebBrowserToolbar.InitBrowser(this); }
protected void GetComponetBindAction(UIBehaviour _comp, string _strComName, UnityAction <string> _strAction = null) { if (_comp == null) { Transform _compTrans = GetTransform.FindChild(_strComName); if (_compTrans != null) { _comp = _compTrans.GetComponent <UIBehaviour>(); } } if (_comp != null) { if (_comp is Button) { (_comp as Button).onClick.AddListener(() => { _strAction.Invoke(DialogPrompt.text); }); } else if (_comp is InputField) { (_comp as InputField).onEndEdit.AddListener(_strAction); } } }
public void InitPrefabLinks() { GetComponetBindAction(UrlField, "Controller/UrlField", EToolbar.ETB_Url, _strAction: m_browser.OnToolbarUrlFieldEndEdit); GetComponetBindAction(BackBtn, "Controller/BackBtn", EToolbar.ETB_Back, _action: m_browser.OnToolbarBackBtnClick); GetComponetBindAction(ForwardBtn, "Controller/ForwardBtn", EToolbar.ETB_Forward, _action: m_browser.OnToolbarForwardBtnClick); GetComponetBindAction(CloseBtn, "Controller/CloseBtn", EToolbar.ETB_Close, _action: m_browser.OnToolbarCloseBtnClick); GetComponetBindAction(PullBtn, "Controller/PullBtn", null, _action: OnPullBtnClick); SetToolbarItemUse(Toolbar); if (Background == null) { //2d Background = GetTransform.GetComponent <Image>(); } if (ControllerTrans == null) { ControllerTrans = GetTransform.FindChild("Controller").transform as RectTransform; } if ((int)Toolbar == 0) { ControllerTrans.gameObject.SetActive(false); } if (IsAutoHide) { Background.raycastTarget = false; ControllerTrans.anchoredPosition = new Vector2(0, 25); ControllerTrans.sizeDelta = new Vector2(0, 50); } }