private IEnumerator showSpeech(DCinematicSpeech speechData) { if (string.IsNullOrEmpty(speechData.MascotName) && Service.Get <QuestService>().ActiveQuest != null) { speechData.MascotName = Service.Get <QuestService>().ActiveQuest.Mascot.Name; } GameObject mascotGO = getMascotFromName(speechData.MascotName); if (mascotGO != null) { speechData.MascotTarget = mascotGO; } else { speechData.HideTail = true; } if (string.IsNullOrEmpty(speechData.BubbleContentKey)) { speechData.BubbleContentKey = "Prefabs/Quest/CinematicSpeechBubbles/CinematicSpeechBubbleDynamic"; } AssetRequest <GameObject> assetRequest = Content.LoadAsync <GameObject>(speechData.BubbleContentKey); yield return(assetRequest); GameObject speechGameObject = Object.Instantiate(assetRequest.Asset); speechGameObject.transform.SetParent(canvas.transform, worldPositionStays: false); CinematicSpeechBubble cinematicSpeechBubble = speechGameObject.GetComponent <CinematicSpeechBubble>(); activeSpeechBubbles.Add(cinematicSpeechBubble); cinematicSpeechBubble.ShowSpeech(speechData); fullScreenButton.SetActive(clickToClose()); }
public void OnShowSpeechClick() { DCinematicSpeech dCinematicSpeech = new DCinematicSpeech(); dCinematicSpeech.Text = Service.Get <Localizer>().GetTokenTranslation(SpeechInput.text); dCinematicSpeech.BubbleContentKey = "Prefabs/Quest/CinematicSpeedBubbles/CinematicSpeechBubbleDynamic"; DButton dButton = new DButton(); dButton.Text = "Yes"; dButton.ButtonPrefabKey = "Prefabs/Buttons/Button_Test"; DButton dButton2 = new DButton(); dButton2.Text = "No"; dButton2.ButtonPrefabKey = "Prefabs/Buttons/Button_Test"; dCinematicSpeech.Buttons = new DButton[2] { dButton, dButton2 }; DTextStyle dTextStyle = new DTextStyle(); dTextStyle.ColorHex = "08FF08"; dTextStyle.FontContentKey = "Fonts/Draculon-Regular"; dCinematicSpeech.TextStyle = dTextStyle; dCinematicSpeech.BackgroundImageKey = "Sprites/CinematicSpeechBubbles/CinematicSpeachBubble_RockHopper"; Service.Get <EventDispatcher>().DispatchEvent(new CinematicSpeechEvents.ShowSpeechEvent(dCinematicSpeech)); }
private CinematicSpeechBubble speechDataToActiveBubble(DCinematicSpeech speechData) { CinematicSpeechBubble result = null; for (int i = 0; i < activeSpeechBubbles.Count; i++) { if (activeSpeechBubbles[i].SpeechData == speechData) { result = activeSpeechBubbles[i]; } } return(result); }
public SpeechCompleteEvent(DCinematicSpeech speechData) { SpeechData = speechData; }
public HideSpeechEvent(DCinematicSpeech speechData) { SpeechData = speechData; }
public ShowSpeechEvent(DCinematicSpeech speechData, bool hideQuestHud = true) { SpeechData = speechData; HideQuestHud = hideQuestHud; }