Пример #1
0
        private void Update()
        {
            if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))
            {
                if (!_utalk.IsTalking)
                {
                    var info = new TalkInfo("Default", "SubGroup", "Talk1", Language.English);

                    _utalk.StartTalk(_talkCloud, info, Handler);
                }
                else
                {
                    var movedToNextPage = _utalk.NextPage();

                    if (!movedToNextPage)
                    {
                        _utalk.SetWriteSpeed(WriteSpeedType.Fast);
                    }
                }
            }
            else if (_utalk.IsTalking && (Input.GetMouseButtonUp(0) || Input.GetKeyUp(KeyCode.Space)))
            {
                _utalk.SetWriteSpeed(WriteSpeedType.Normal);
            }
        }
Пример #2
0
        public void StartTalk(TalkCloudBase cloud, TalkInfo talkInfo, Action <TalkEvent> talkCallback)
        {
            if (!_isTalking)
            {
                _talkCallback = talkCallback;

                StartTalk(cloud, talkInfo);
            }
        }
Пример #3
0
        public void StartTalk(TalkCloudBase cloud, TalkInfo talkInfo, Action <TalkEvent> talkCallback, Action <string> wordEventCallback)
        {
            if (!_isTalking)
            {
                _onWordEventCallBack = wordEventCallback;

                StartTalk(cloud, talkInfo, talkCallback);
            }
        }
Пример #4
0
        public void StartTalk(TalkCloudBase cloud, TalkInfo talkInfo)
        {
            if (!_isTalking)
            {
                _talkData = _scriptableContainer.Container.GetTalkAsset(talkInfo);

                StartTalk(cloud, _talkData);
            }
        }
Пример #5
0
 //Call it when a talk is running and the language is changed to update the cloud talk with the new text.
 /// <summary>Call when the language is changed.</summary>
 public void SetTalkOnLanguageChanged(TalkInfo info)
 {
     if (_scriptableContainer)
     {
         if (_talkData)
         {
             _talkData = _scriptableContainer.Container.GetTalkAsset(info);
             _writerControl.Writer.OnLanguageChanged(_talkData.GetPage(_pageIndex));
         }
     }
     else
     {
         Debug.LogError("Container reference wasn't added.");
     }
 }