Beispiel #1
0
        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());
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public SpeechCompleteEvent(DCinematicSpeech speechData)
 {
     SpeechData = speechData;
 }
Beispiel #5
0
 public HideSpeechEvent(DCinematicSpeech speechData)
 {
     SpeechData = speechData;
 }
Beispiel #6
0
 public ShowSpeechEvent(DCinematicSpeech speechData, bool hideQuestHud = true)
 {
     SpeechData   = speechData;
     HideQuestHud = hideQuestHud;
 }