コード例 #1
0
    public void LateUpdate()
    {
        if (WindowSystem.IsUIHovered() == true)
        {
            return;
        }

        if (this.cam == null)
        {
            this.cam = Camera.main;
        }
        if (this.cam == null)
        {
            return;
        }

        var        ray = this.cam.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 100f, 1 << this.gameObject.layer) == true && hit.collider.GetComponent <Example3DHover>() == this)
        {
            if (this.tip == null)
            {
                this.tip = WindowSystem.Show <UIWindowExampleTip>(this.hoverText) as TipWindowType;
                this.tip.OnHover(this.transform, hit.point, this.cam, this.offset);
            }
        }
        else if (this.tip != null)
        {
            this.tip.Hide();
            this.tip.OnLeave();
            this.tip = null;
        }
    }
コード例 #2
0
ファイル: TipsManager.cs プロジェクト: zuojiashun/src
 /// <summary>
 /// 显示提示窗口
 /// </summary>
 /// <param name="type">窗口类型</param>
 /// <param name="tipContent">提示内容</param>
 /// <param name="okCallBack">确定回调</param>
 /// <param name="cancelCallBack">取消回调</param>
 /// <param name="okstr">确定按钮上的文本</param>
 /// <param name="cancleStr">取消按钮上是文本</param>
 /// <param name="title">标题</param>
 public void ShowTipWindow(TipWindowType type, string tipContent, Action okCallBack, Action cancelCallBack = null, Action closeCallBack = null,
                           string title     = "提示",
                           string okstr     = "确定",
                           string cancleStr = "取消",
                           uint _color      = 0x000000)
 {
     DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PrompdPanel, panelShowAction: (pb) =>
     {
         if (null != pb && pb is PrompdPanel)
         {
             PrompdPanel panel = pb as PrompdPanel;
             if (panel != null)
             {
                 panel.Init(new TipWidnowParam()
                 {
                     windowtype = type,
                     winContent = tipContent,
                     winTitle   = title,
                     ok         = okCallBack,
                     cancel     = cancelCallBack,
                     close      = closeCallBack,
                     oktxt      = okstr,
                     canletxt   = cancleStr,
                     color      = _color,
                 });
             }
         }
     });
 }
コード例 #3
0
        public override void OnHideBegin(System.Action callback, bool immediately = false)
        {
            base.OnHideBegin(callback, immediately);

            this.OnStateChanged(state: false);
            this.infoWindow = null;
        }
コード例 #4
0
        public override void OnDeinit()
        {
            base.OnDeinit();

            this.OnStateChanged(state: false);
            this.infoWindow = null;
        }
コード例 #5
0
    public static TipWindowUI Create(Transform parent, TipWindowType type = TipWindowType.oneButton)
    {
        var window = Instantiate(LoadResources
                                 .Load <TipWindowUI>(UIName.prefab_tipWindow), parent);

        if (type == TipWindowType.oneButton)
        {
            window.twoButton1.gameObject.SetActive(false);
            window.twoButton2.gameObject.SetActive(false);
        }
        else if (type == TipWindowType.twoButton)
        {
            window.oneButton1.gameObject.SetActive(false);
        }

        return(window);
    }
コード例 #6
0
 public void OnStateChanged(bool state)
 {
     if (state == true)
     {
         this.infoWindow = WindowSystem.Show <UIWindowExampleTip>(this.tipText) as TipWindowType;
         this.infoWindow.OnHover(this.transform as RectTransform);
     }
     else
     {
         if (this.infoWindow != null)
         {
             this.infoWindow.OnLeave();
             this.infoWindow.Hide();
             this.infoWindow = null;
         }
     }
 }
コード例 #7
0
 public void OnHover()
 {
     this.infoWindow = WindowSystem.Show <UIWindowExampleTip>(this.text) as TipWindowType;
     this.infoWindow.OnHover(this.transform as RectTransform);
 }
コード例 #8
0
 public void OnHover()
 {
     this.infoWindow = WindowSystem.Show <UIWindowExampleTip>((w) => w.OnParametersPass(this.text)) as TipWindowType;
     this.infoWindow.OnHover(this.transform as RectTransform);
 }