コード例 #1
0
        public VRBrowserPanel OpenNewTab(VRBrowserPanel nextTo = null)
        {
            var tabGO = Instantiate(browserPrefab, BroserTransform);

            tabGO.SetActive(true);
            var tab = tabGO.GetComponent <VRBrowserPanel>();

            var insertIndex = -1;

            if (nextTo)
            {
                insertIndex = allBrowsers.FindIndex(x => x == nextTo);
            }
            if (insertIndex > 0)
            {
                allBrowsers.Insert(insertIndex + 1, tab);
            }
            else
            {
                allBrowsers.Insert(allBrowsers.Count / 2, tab);
            }

            tab.transform.position   = BroserTransform.position;
            tab.transform.rotation   = BroserTransform.rotation;
            tab.transform.localScale = Vector3.zero;

            return(tab);
        }
コード例 #2
0
        private IEnumerator DestroyBrowser(VRBrowserPanel pane)
        {
            //drop the pane and destroy it
            allBrowsers.Remove(pane);
            if (!pane)
            {
                yield break;
            }

            var targetPos = pane.transform.position;

            targetPos.y = 0;

            var t0 = Time.time;

            while (Time.time < t0 + 3)
            {
                if (!pane)
                {
                    yield break;
                }
                MoveToward(pane.transform, Vector3.zero);
                yield return(null);
            }

            Destroy(pane.gameObject);
        }
コード例 #3
0
 public void MoveKeyboardUnder(VRBrowserPanel panel)
 {
     keyboardTarget = panel;
 }
コード例 #4
0
 public void DestroyPane(VRBrowserPanel pane)
 {
     StartCoroutine(_DestroyBrowser(pane));
 }