Example #1
0
 Transform GetTip(TipType tipType)
 {
     try
     {
         RectTransform tf = transform.Find(tipType.ToString()) as RectTransform;
         if (!tf || tipType == TipType.SimpleTip)
         {
             if (tf && tipType == TipType.SimpleTip)
             {
                 Destroy(tf.gameObject);
             }
             tf = BundleManager.Instance.GetGameObject(GetTipPath(tipType)).transform as RectTransform;
             tf.SetParent(transform);
             tf.anchoredPosition = Vector3.zero;
             tf.sizeDelta        = Vector3.zero;
             tf.localScale       = Vector3.one;
         }
         tf.gameObject.SetActive(false);
         return(tf);
     }
     catch
     {
         return(null);
     }
 }
Example #2
0
 public void TipShow(Control parentControl,string tipText,TipType tiptype)
 {
     type = tiptype.ToString();
     label1.Text = tipText;
     parentControl.Controls.Add(this);
     this.BringToFront();
 }
Example #3
0
 public void TipShow(Control parentControl, string tipText, TipType tiptype)
 {
     type        = tiptype.ToString();
     label1.Text = tipText;
     parentControl.Controls.Add(this);
     this.BringToFront();
 }
Example #4
0
        /// <summary> Shows the tips. </summary>
        /// <param name="type"> The type.</param>
        public void ShowTips(TipType type)
        {
            switch (type)
            {
            case TipType.UnInitialized:
            case TipType.LostTracking:
                GameObject go;
                m_TipsDict.TryGetValue(type, out go);
                int layer = LayerMaskToLayer(m_TipsLayer);
                if (go == null)
                {
                    go = Instantiate(Resources.Load(type.ToString() + "Tip"), centerCamera.transform) as GameObject;
                    m_TipsDict.Add(type, go);
                    go.layer = layer;
                    foreach (Transform child in go.transform)
                    {
                        child.gameObject.layer = layer;
                    }
                }
                if (go != m_CurrentTip)
                {
                    m_CurrentTip?.SetActive(false);
                    go.SetActive(true);
                    m_CurrentTip = go;
                }
                NRSessionManager.Instance.NRHMDPoseTracker.leftCamera.cullingMask  = 1 << layer;
                NRSessionManager.Instance.NRHMDPoseTracker.rightCamera.cullingMask = 1 << layer;
                break;

            case TipType.None:
                if (m_CurrentTip != null)
                {
                    m_CurrentTip.SetActive(false);
                }
                m_CurrentTip = null;
                NRSessionManager.Instance.NRHMDPoseTracker.leftCamera.cullingMask  = originLayerLCam;
                NRSessionManager.Instance.NRHMDPoseTracker.rightCamera.cullingMask = originLayerRCam;
                break;

            default:
                break;
            }
        }
Example #5
0
        public void ShowTips(TipType type)
        {
            switch (type)
            {
            case TipType.UnInitialized:
            case TipType.LostTracking:
                GameObject go;
                m_TipsDict.TryGetValue(type, out go);

                if (go == m_CurrentTip && go != null)
                {
                    return;
                }

                if (go != null)
                {
                    go.SetActive(true);
                }
                else
                {
                    go = Instantiate(Resources.Load(type.ToString() + "Tip"), centerCamera.transform) as GameObject;
                    m_TipsDict.Add(type, go);
                }

                if (m_CurrentTip != null)
                {
                    m_CurrentTip.SetActive(false);
                }
                m_CurrentTip = go;
                break;

            case TipType.None:
                if (m_CurrentTip != null)
                {
                    m_CurrentTip.SetActive(false);
                }
                break;

            default:
                break;
            }
        }
Example #6
0
 string GetTipPath(TipType tipType)
 {
     return("tips/" + tipType.ToString());
 }