Exemplo n.º 1
0
    public void WriteText(int numText)
    {
        switch (numText)
        {
        case 1:
            textWriter.AddWriter(messageText, text1, 0.05f, true);
            break;

        case 2:
            textWriter.AddWriter(messageText, text2, 0.05f, true);
            break;

        case 4:
            textWriter.AddWriter(messageText, textRepair, 0.05f, true);
            break;

        case 5:
            textWriter.AddWriter(messageText, textForge, 0.05f, true);
            break;

        case 6:
            textWriter.AddWriter(messageText, textBuy, 0.05f, true);
            break;
        }
    }
 public static WriteElement AddWriteInstance(TextMeshPro textComponent
                                             , string text
                                             , float charTime
                                             , bool removeRedundant)
 {
     if (removeRedundant)
     {
         _instance.RemoveWriter(textComponent);
     }
     return(_instance.AddWriter(textComponent, text, charTime));
 }
Exemplo n.º 3
0
 private IEnumerator ShowStory()  // 文字內容,文字時間,文字是否透明
 {
     tw.AddWriter(story_text,
                  "西元4682年,你誕生於一個單親家庭中。" +
                  "在你出生以前星球已經因為經歷了大大小小生化武器的戰爭。" +
                  "導致星球上的生物多數已經突變成怪物了。" +
                  "在你18歲的那年,你父親在前往山上劈柴的途中被火龍襲擊而身亡,為此你悲痛欲絕。" +
                  "在經過了2天的意志消沉之後你決定拿起父親遺留在現場的武器,誓言要打倒世上所有的怪物。" +
                  "為了不希望再有家庭體驗到這種切身之痛,於是你踏上了旅程。", 0.02f, false);
     yield return(null);
 }
Exemplo n.º 4
0
        public void ShowCombatPreview(Encounter encounter, string result, List <Entity> enemies)
        {
            HideButtons();

            if (string.IsNullOrEmpty(encounter.ImageName))
            {
                ImageContainer.SetActive(false);
            }
            else
            {
                var spriteStore = FindObjectOfType <SpriteStore>();

                var image = spriteStore.GetEncounterSprite(encounter.ImageName); //todo get a combat preview image

                if (image == null)
                {
                    ImageContainer.SetActive(false);
                }
                else
                {
                    Image.sprite = image;
                    ImageContainer.SetActive(true);
                }
            }

            _encounterType = EncounterType.Combat;

            EncounterTitle.text = encounter.Title;

            _enemies = enemies;

            _textWriter.AddWriter(ResultDescription, result, GlobalHelper.DefaultTextSpeed, true);

            gameObject.SetActive(true);

            GameManager.Instance.AddActiveWindow(gameObject);

            var sound = FMODUnity.RuntimeManager.CreateInstance(popupSound);

            sound.start();
        }
Exemplo n.º 5
0
        public void Show(List <string> result)
        {
            var resultText = string.Empty;

            foreach (var line in result)
            {
                resultText += '\n' + line;
            }

            _textWriter.AddWriter(ResultDescription, resultText, GlobalHelper.DefaultTextSpeed, true);

            gameObject.SetActive(true);

            GameManager.Instance.AddActiveWindow(gameObject);
        }
Exemplo n.º 6
0
        private void Show(Encounter encounter)
        {
            EncounterTitle.text = encounter.Title;

            if (string.IsNullOrEmpty(encounter.ImageName))
            {
                ImageContainer.SetActive(false);
            }
            else
            {
                var spriteStore = FindObjectOfType <SpriteStore>();

                var image = spriteStore.GetEncounterSprite(encounter.ImageName);

                if (image == null)
                {
                    ImageContainer.SetActive(false);
                }
                else
                {
                    Image.sprite = image;
                    ImageContainer.SetActive(true);
                }
            }

            _textWriter.AddWriter(EncounterDescription, encounter.Description, GlobalHelper.DefaultTextSpeed, true);

            DisableAllButtons();

            var optionButtonIndex = 0;

            foreach (var optionText in encounter.Options.Keys)
            {
                var button = _optionButtons[optionButtonIndex].GetComponent <EncounterOptionButton>();

                button.SetOptionText(optionText);

                button.Show();

                optionButtonIndex++;
            }

            gameObject.SetActive(true);
            GameManager.Instance.AddActiveWindow(gameObject);
        }
Exemplo n.º 7
0
        private void Show(Encounter encounter)
        {
            _travelMessenger.ClearMessageQueues();

            //todo might want to hide messages at this point too?

            _encounter = encounter;

            if (string.IsNullOrEmpty(encounter.ImageName))
            {
                ImageContainer.SetActive(false);
            }
            else
            {
                var spriteStore = FindObjectOfType <SpriteStore>();

                var image = spriteStore.GetEncounterSprite(encounter.ImageName);

                if (image == null)
                {
                    ImageContainer.SetActive(false);
                }
                else
                {
                    Image.sprite = image;
                    ImageContainer.SetActive(true);
                }
            }

            EncounterTitle.text = _encounter.Title;

            DisableAllButtons();

            _textWriter.AddWriter(EncounterDescription, _encounter.Description, GlobalHelper.DefaultTextSpeed, true);

            gameObject.SetActive(true);
            GameManager.Instance.AddActiveWindow(gameObject);

            var sound = FMODUnity.RuntimeManager.CreateInstance(popupSound);

            sound.start();
        }
Exemplo n.º 8
0
        public void Show()
        {
            uiContainer.SetActive(true);
            GameManager.Instance.AddActiveWindow(uiContainer);

            if (_textWriter == null)
            {
                _textWriter = GetComponent <TextWriter>();
            }

            _textWriter.AddWriter(resultDescription, resultDescription.text, GlobalHelper.DefaultTextSpeed, true);

            var sound = FMODUnity.RuntimeManager.CreateInstance(popupSound);

            sound.start();

            var eventMediator = FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.PauseTimer, this);
        }
Exemplo n.º 9
0
 private void Start()
 {
     textWriter.AddWriter(messageText, scenarios, timePerCharacters, sceneNameToLoad);
 }
Exemplo n.º 10
0
 void Start()
 {
     textWriter.AddWriter(messageText, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id faucibus enim. " +
                          "Curabitur vitae suscipit sapien. Aliquam sit amet mauris a leo fringilla fermentum nec ac lectus. In gravida in est sit amet volutpat.", 0.1f, true);
 }
Exemplo n.º 11
0
 //Text used in opening cutscene
 public void SendText(int textCount)
 {
     textWriter.AddWriter(messageText, displayText[textCount], .1f, true);
 }
Exemplo n.º 12
0
 // Start is called before the first frame update
 void Start()
 {
     //messageText.text = "Testing";
     textWriter.AddWriter(messageText, textColl[0], 0.1f);
     textSeg = 1;
 }
Exemplo n.º 13
0
 void Start()
 {
     messageText.text = "";
     textWriter.AddWriter(messageText, "LOADING CASE . . . \n\nCase : Lost Kid \n\nLocation : WCLK-Hospital\n\nStatus : Case Close.\n\nDetails : . . . . ", .075f, true);
 }
Exemplo n.º 14
0
 private void Start()
 {
     textWriter.AddWriter(messageText, "Display Message Here", 0.2f);
 }
 private void Start()
 {
     textWriter.AddWriter(messageText, "Ecopoint Isolation", .2f, true);
 }
Exemplo n.º 16
0
 void Start()
 {
     textWriter.AddWriter(messageText, "Living alone and never having had a girlfriend, 37-year-old Satoru Mikami is dissatisfied with how his life has turned out. " +
                          "But after dying at the hands of a robber, he awakens to a fresh start in a new world... as a slime monster.", 0.1f, true);
 }
Exemplo n.º 17
0
 private void Start()
 {
     textWriter.AddWriter(messageText, Text, .1f, true);
 }