private IEnumerator Start() { if (!string.IsNullOrEmpty(StateMachineToCheck)) { StateMachineContext stateMachineContext = GetComponentInParent <StateMachineContext>(); while (!stateMachineContext.ContainsStateMachine(StateMachineToCheck)) { yield return(null); } string state = stateMachineContext.GetStateMachineState(StateMachineToCheck); int num = 0; while (true) { if (num < StatesToEvents.Length) { if (StatesToEvents[num].State == state) { break; } num++; continue; } yield break; } stateMachineContext.SendEvent(new ExternalEvent(Target, StatesToEvents[num].Event)); } else { Log.LogError(this, "StateMachineToCheck was null or empty"); } }
public override void SetInputFieldSelected() { CoroutineRunner.Start(selectInputField(), this, "selectInputField"); base.SetInputFieldSelected(); StateMachineContext componentInParent = GetComponentInParent <StateMachineContext>(); if (componentInParent != null && componentInParent.ContainsStateMachine("Root")) { componentInParent.SendEvent(new ExternalEvent("Root", "chat_input")); } }
public override void OnEnter() { findWorldTrayFSMContext(); canFinish = trayFSMContext.ContainsStateMachine("Root"); switch (TrayActionType) { case TrayControlActionType.exitCinematic: lastTrayAction = exitCinematic; break; case TrayControlActionType.selectScreen: lastTrayAction = selectTrayScreen; break; case TrayControlActionType.maxCinematic: lastTrayAction = enterMaxCinematicAndSelectScreen; break; case TrayControlActionType.minCinematic: lastTrayAction = enterMinCinematic; break; case TrayControlActionType.minMainNav: lastTrayAction = enterMinMainNav; break; } switch (MainNavActionType) { case MainNavButtonActionType.disable: disableMainNav(); break; case MainNavButtonActionType.enable: enableMainNav(); break; } resetLocomotionState(); if (canFinish) { if (lastTrayAction != null) { lastTrayAction(); } Finish(); } else if (!isWaitingForFSM) { trayFSMContext.StateMachineLoaded += FinishWhenFSMAdded; isWaitingForFSM = true; } }
private IEnumerator Start() { smc = GetComponentInParent <StateMachineContext>(); CloseButtonContainer.SetActive(value: true); findRootKeyboardEventSource(); if (MonoSingleton <NativeAccessibilityManager> .Instance.IsEnabled) { while (!smc.ContainsStateMachine("Root")) { yield return(null); } smc.SendEvent(new ExternalEvent("ChatFullScreenLoader", "enable")); } }
private void Start() { if (!string.IsNullOrEmpty(Target)) { StateMachineContext stateMachineContext = GetComponentInParent <StateMachineContext>(); if (stateMachineContext == null) { GameObject gameObject = GameObject.FindGameObjectWithTag(UIConstants.Tags.UI_Tray_Root); if (gameObject != null) { stateMachineContext = gameObject.GetComponent <StateMachineContext>(); } } if (stateMachineContext != null) { if (stateMachineContext.ContainsStateMachine(Target)) { stateMachineContext.SendEvent(new ExternalEvent(Target, Event)); } else { CoroutineRunner.Start(sendEventAtEndOfFrame(stateMachineContext, new ExternalEvent(Target, Event)), this, "Start Event Delay"); } } else if (!AllowMissingStateMachine) { Log.LogError(this, "Could not find a StateMachineContext"); } } else { StateMachine component = GetComponent <StateMachine>(); if (component != null) { component.SendEvent(Event); } else { Log.LogError(this, "Could not find a StateMachine"); } } }
public void ShowPrompt(DPrompt data, Action <DPrompt.ButtonFlags> callback) { localizer = Service.Get <Localizer>(); GameObject gameObject = GameObject.FindGameObjectWithTag(UIConstants.Tags.UI_Tray_Root); if (gameObject != null) { stateMachineContext = gameObject.GetComponent <StateMachineContext>(); if (stateMachineContext != null && stateMachineContext.ContainsStateMachine("Root")) { stateMachineContext.SendEvent(new ExternalEvent("Root", "popup_open")); } } updateTextFields(data); updateImages(data); ModalBackground component = GetComponent <ModalBackground>(); component.enabled = data.IsModal; if (data.UseCloseButton) { if (CloseButton != null) { CloseButton.SetActive(value: true); ButtonClickListener component2 = CloseButton.GetComponent <ButtonClickListener>(); component2.OnClick.AddListener(onButtonClicked); } else { Log.LogError(this, "CloseButton is null, cannot activate it"); } } ButtonClickListener btnAccept = null; ButtonClickListener btnCancel = null; for (int i = 0; i < Buttons.Length; i++) { createButton(data, i, callback, ref btnAccept, ref btnCancel); } inputHandler.Initialize(btnAccept, btnCancel); playAccessibilityText(); }
private IEnumerator Start() { if (!string.IsNullOrEmpty(StateMachineToCheck)) { StateMachineContext stateMachineContext = GetComponentInParent <StateMachineContext>(); while (!stateMachineContext.ContainsStateMachine(StateMachineToCheck)) { yield return(null); } string state = stateMachineContext.GetStateMachineState(StateMachineToCheck); for (int i = 0; i < StatesToEvents.Length; i++) { if (StatesToEvents[i].State == state) { stateMachineContext.SendEvent(new ExternalEvent(Target, StatesToEvents[i].Event)); break; } } } else { Log.LogError(this, "StateMachineToCheck was null or empty"); } }