public override void InitUI() { base.InitUI(); if (UITransform == null) { return; } _prefabManager.triggerActionsParent = UITransform; var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>(); var go = new GameObject(); go.transform.SetParent(scriptUI.fullWidthUIContent, false); var active = go.activeInHierarchy; if (active) { go.SetActive(false); } _ui = go.AddComponent <CustomCommandsScreen>(); _ui.prefabManager = _prefabManager; _ui.customCommands = _customCommands; _ui.Configure(); if (active) { go.SetActive(true); } }
private IEnumerator InitUIDeferred() { yield return(StartCoroutine(VamPrefabFactory.LoadUIAssets())); var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>(); var scrollRect = scriptUI.fullWidthUIContent.transform.parent.parent.parent.GetComponent <ScrollRect>(); if (scrollRect == null) { SuperController.LogError("VamTimeline: Scroll rect not at the expected hierarchy position"); } else { scrollRect.elasticity = 0; scrollRect.inertia = false; scrollRect.movementType = ScrollRect.MovementType.Clamped; } ui = Editor.AddTo(scriptUI.fullWidthUIContent); ui.popupParent = UITransform; ui.Bind(this); if (animation != null) { ui.Bind(animation); } ui.screensManager.onScreenChanged.AddListener(screen => { if (controllerInjectedUI != null) { controllerInjectedUI.screensManager.ChangeScreen(screen); } peers.SendScreen(screen); }); }
public override void InitUI() { base.InitUI(); if (UITransform == null) { return; } var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>(); var resultUI = CreateTextField(_resultJSON, true); resultUI.height = 1200f; resultUI.UItext.horizontalOverflow = HorizontalWrapMode.Overflow; resultUI.transform.SetParent(scriptUI.fullWidthUIContent.transform, false); }
public override void InitUI() { base.InitUI(); if (UITransform == null) { return; } var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>(); _runUI.transform.SetParent(scriptUI.fullWidthUIContent.transform, false); var resultUI = CreateTextField(_resultJSON, true); resultUI.height = 800f; resultUI.transform.SetParent(scriptUI.fullWidthUIContent.transform, false); }
public override void InitUI() { base.InitUI(); if (!_valid) { return; } if (UITransform == null) { return; } _prefabManager.triggerActionsParent = UITransform; var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>(); var go = new GameObject(); go.transform.SetParent(scriptUI.fullWidthUIContent, false); var active = go.activeInHierarchy; if (active) { go.SetActive(false); } _ui = go.AddComponent <KeybindingsScreen>(); _ui.settings = _settings; _ui.prefabManager = _prefabManager; _ui.keyMapManager = _keyMapManager; _ui.analogMapManager = _analogMapManager; _ui.remoteCommandsManager = _remoteCommandsManager; _ui.storage = _storage; _ui.Configure(); if (active) { go.SetActive(true); } var overlay = KeybindingsOverlay.CreateOverlayGameObject(_prefabManager); overlay.autoClear = Settings.TimeoutLen; _overlayReference.value = overlay; // overlay.Append("Keybindings ready!"); }
private IEnumerator InitUIDeferred() { if ((UnityEngine.Object)ui != (UnityEngine.Object)null || _initializingUI) { yield break; } _initializingUI = true; yield return(SuperController.singleton.StartCoroutine(VamPrefabFactory.LoadUIAssets())); var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>(); var scrollRect = scriptUI.fullWidthUIContent.transform.parent.parent.parent.GetComponent <ScrollRect>(); if ((UnityEngine.Object)scrollRect == (UnityEngine.Object)null) { SuperController.LogError( "AudioMate: Error during UI initialization. Scroll rect not at the expected hierarchy position"); } else { scrollRect.elasticity = 0; scrollRect.inertia = false; scrollRect.movementType = ScrollRect.MovementType.Clamped; } ui = UIManager.AddTo(scriptUI.fullWidthUIContent); if ((UnityEngine.Object)ui == (UnityEngine.Object)null) { SuperController.LogError( "AudioMate: Error during UI initialization. UI is null."); } ui.Init(this); ui.ReceiverAtomJSON = _receivingAtomJSON; ui.ReceiverNodeJSON = _receivingNodeJSON; ui.InitUI(); //if ((UnityEngine.Object) collections == (UnityEngine.Object) null || !collections.isInitialized) yield return new WaitForEndOfFrame(); var count = 0; while ((UnityEngine.Object)collections == (UnityEngine.Object)null || !collections.isInitialized) { if (++count > 200) { SuperController.LogError(!collections.isInitialized ? "AudioMate: Could not initialize collection manager." : "AudioMate: Collection manager is null."); yield break; } yield return(new WaitForSeconds(.1f)); if ((UnityEngine.Object) this == (UnityEngine.Object)null) { yield break; } } try { ui.Bind(collections); } catch (Exception e) { SuperController.LogError($"AudioMate: {e}"); } }