protected override void Awake() { base.Awake(); _isDeath = false; _agent = GetComponent <NavMeshAgent>(); _weapons = GetTransform.Find("Gun").GetComponent <Weapons>(); }
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); } } }
internal virtual void SetVisible(bool visible) { gameObject.SetActive(visible); if (visible && m_bPopupView) { GetTransform.SetAsLastSibling(); } }
public void Draw(SpriteBatch spriteBatch) { if (saveTexture == null) { return; } GetTransform.SetPosition(saveTexture.Bounds.Size.ToVector2()); spriteBatch.Draw(GetTexture(GetTransform.angle), GetTransform.Rect, Color.White); }
public virtual void InitPrefabLinks() { if (DialogText == null) { DialogText = GetTransform.Find("DialogText").gameObject.GetComponent <Text>(); } GetComponetBindAction(OkBtn, "OkBtn", _strAction: m_browser.OnDialogOKBtnClick); GetComponetBindAction(YesBtn, "YesBtn", _strAction: m_browser.OnDialogYesBtnClick); GetComponetBindAction(NoBtn, "NoBtn", _strAction: m_browser.OnDialogCancelBtnClick); if (DialogPrompt == null) { DialogPrompt = GetTransform.Find("DialogPrompt").gameObject.GetComponent <InputField>(); } SetVisible(false); }
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); } }
/// <summary> /// Transforms a point of the given reference system to a point of another reference system. /// </summary> /// <param name="p">The point to transform.</param> /// <param name="sourceSrid">The current reference system.</param> /// <param name="destSrid">The desired reference system.</param> /// <returns>The transformed point.</returns> public static Point Transform(Point p, string sourceSrid, string destSrid) { return(GetTransform(sourceSrid, destSrid)(p)); }
public void SetGetterCallbacks(GetGridFight getGridFight, GetTransform getTransform) { m_getGridFight = getGridFight; m_getTransform = getTransform; }
public ChartDataEventReturn(GetTransform pFunction) { Transform = pFunction; }