Exemplo n.º 1
0
 protected override void Awake()
 {
     base.Awake();
     _isDeath = false;
     _agent   = GetComponent <NavMeshAgent>();
     _weapons = GetTransform.Find("Gun").GetComponent <Weapons>();
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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);
                }
            }
        }
Exemplo n.º 4
0
 internal virtual void SetVisible(bool visible)
 {
     gameObject.SetActive(visible);
     if (visible && m_bPopupView)
     {
         GetTransform.SetAsLastSibling();
     }
 }
Exemplo n.º 5
0
 public void Draw(SpriteBatch spriteBatch)
 {
     if (saveTexture == null)
     {
         return;
     }
     GetTransform.SetPosition(saveTexture.Bounds.Size.ToVector2());
     spriteBatch.Draw(GetTexture(GetTransform.angle), GetTransform.Rect, Color.White);
 }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
                }
            }
        }
Exemplo n.º 9
0
        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);
            }
        }
Exemplo n.º 10
0
 /// <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));
 }
Exemplo n.º 11
0
 public void SetGetterCallbacks(GetGridFight getGridFight, GetTransform getTransform)
 {
     m_getGridFight = getGridFight;
     m_getTransform = getTransform;
 }
Exemplo n.º 12
0
 public ChartDataEventReturn(GetTransform pFunction)
 {
     Transform = pFunction;
 }