Esempio n. 1
0
    public void DisplayWindow_Inspector()//显示玩家属性窗口
    {
        if (windowed)
        {
            return;
        }

        PauseGame();           //暂停游戏

        if (null == inspector) //如果不存在,则读取
        {
            GameObject _inspector = Resources.Load <GameObject>("Prefabs/GameUI-Inspector");
            inspector = Instantiate(_inspector).GetComponent <TabSelect>();//实例化

            inspector.transform.SetParent(cvs, false);
            //调整层级
            inspector.transform.SetAsLastSibling();
        }
        //告知管理,禁用按钮
        DisplayWindow(true, new Color(1, 1, 1, 0.9f));//窗口颜色为半透明白色
        //单独调用属性窗口的弹出事件
        inspector.ShowInspector();
        player.HideStatus();//隐藏血条和能量条
        HeadIcon.HideButton(false);
        //修改背景点击事件
        onClickOrEsc.RemoveAllListeners();
        onClickOrEsc.AddListener(CloseWindow_Inspector);
    }
Esempio n. 2
0
    private GameObject thisPage;  //
    //public GameObject thisPage;//对应页面
    // public Color disabledTxtColor=new Color(0,0,0,0);//未选择时的文字颜色
    // public Color disabledBkgColor = Color.black;//未选择时的背景颜色
    // public Color enabledTxtColor=Color.black;//选择时的文字颜色
    // public Color enabledBkgColor = Color.white;//选择时的背景颜色


    //初始化
    public void InitializeThis()
    {
        //获取对象
        thisimg = transform.GetChild(0).GetComponent <Image>();
        if (null == thisimg)
        {
            thisimg = GetComponent <Image>();
        }
        thisTxt = GetComponentInChildren <Text>();
        //InSelectThis();//开始时未选择
        ts = transform.parent.GetComponent <TabSelect>();
    }
Esempio n. 3
0
        /// <summary>
        /// Выбрать данную вкладку
        /// </summary>

        public void SelectTab()
        {
            for (int i = 0; i < Parent.Controls.Count; i++)
            {
                if (Parent.Controls[i] is TabBox TB)
                {
                    TB.UnSelect();
                }
            }

            TabSelect?.Invoke(this, new EventArgs());
        }
Esempio n. 4
0
        /// <summary>
        /// Opens a tab on the inventory UI if it is not already open
        /// </summary>
        /// <param name="tab">tab to open</param>
        /// <param name="x">x coordinate of the center of the tab</param>
        /// <param name="y">y coordinate of the center of the tab</param>
        /// <param name="safeTab">set to true to click on tab even if it is already believed to be open</param>
        /// <returns>true if the tab is clicked on</returns>
        private bool OpenTab(TabSelect tab, int offsetRight, int offsetBottom, bool safeTab = false)
        {
            if (!safeTab && SelectedTab == tab)
            {
                return(false);
            }
            Point?screenSize = ScreenScraper.GetScreenSize();

            if (screenSize == null)
            {
                return(false);
            }

            int x = screenSize.Value.X - offsetRight;
            int y = screenSize.Value.Y - offsetBottom;

            Mouse.LeftClick(x, y, 10);
            BotProgram.SafeWait(TAB_SWITCH_WAIT);
            SelectedTab = tab;
            return(true);
        }