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); }
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); }
public void MoveKeyboardUnder(VRBrowserPanel panel) { keyboardTarget = panel; }
public void DestroyPane(VRBrowserPanel pane) { StartCoroutine(_DestroyBrowser(pane)); }