Пример #1
0
        private IEnumerator _Escapement(TalkMessage data)
        {
            var message   = data.Message;
            var fixedName = data.Name.Replace("(制服)", string.Empty);

            fixedName         = fixedName.Replace("ボス素顔", "???");
            _UI.Name.text     = fixedName;
            _UI.Sentence.text = string.Empty;
            yield return(null);

            float deltaTime;

            for (int i = 0; i < message.Length; i++)
            {
                deltaTime = 0.0f;
                while (deltaTime < _WaitSec && !InputUtil.AnyButtonDownWithOutPauseButton)
                {
                    deltaTime += Time.deltaTime;
                    yield return(null);
                }
                if (InputUtil.AnyButtonDownWithOutPauseButton)
                {
                    _UI.Sentence.text = data.Message;
                    yield return(_SkipAnimation());

                    break;
                }
                _UI.Sentence.text += message[i];
                yield return(null);
            }
        }
Пример #2
0
        private void _ImageFlip(TalkMessage data)
        {
            return;

            //if (!data.LeftSide.HasValue) { return; }
            //
            //if (!data.IsInside.HasValue) { return; }
            //
            //if (data.LeftSide.Value)
            //{
            //	if (data.IsInside.Value)
            //	{
            //		//右向きの画像を基準にする
            //		_UI.Character.LeftBody.rectTransform.localScale = Vector3.one;
            //	}
            //	else
            //	{
            //		_UI.Character.LeftBody.rectTransform.localScale = new Vector3 (-1, 1, 1);
            //	}
            //}
            //else
            //{
            //	if (data.IsInside.Value)
            //	{
            //		_UI.Character.RightBody.rectTransform.localScale = new Vector3 (-1, 1, 1);
            //	}
            //	else
            //	{
            //		_UI.Character.RightBody.rectTransform.localScale = Vector3.one;
            //	}
            //}
        }
        public ActionResult DeleteConfirmed(int id)
        {
            TalkMessage talkmessage = db.Messages.Find(id);

            db.Messages.Remove(talkmessage);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
 public ActionResult Edit(TalkMessage talkmessage)
 {
     if (ModelState.IsValid)
     {
         db.Entry(talkmessage).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(talkmessage));
 }
        //
        // GET: /TalkMessage/Edit/5

        public ActionResult Edit(int id = 0)
        {
            TalkMessage talkmessage = db.Messages.Find(id);

            if (talkmessage == null)
            {
                return(HttpNotFound());
            }
            return(View(talkmessage));
        }
        public ActionResult Create(TalkMessage talkmessage)
        {
            if (ModelState.IsValid)
            {
                db.Messages.Add(talkmessage);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(talkmessage));
        }
Пример #7
0
    IEnumerator download()
    {
        WWW www = new WWW("https://api.tatsudoya.jp/talk/talk2");

        yield return(www);

        TalkMessage talkMessage = JsonUtility.FromJson <TalkMessage> (www.text);

        Debug.Log(talkMessage.getMessage());

        result.text += talkMessage.getMessage() + "\n";
    }
Пример #8
0
        private IEnumerator _EventEscapement(TalkMessage data)
        {
            yield return(_UnSkippableEscapement(data));

            if (_IsEventEscapementFromAnimationState)
            {
                yield return(_EscapementMessageObserver.First().StartAsCoroutine());
            }
            else
            {
                yield return(_WaitForAnyKeyDown());
            }
        }
Пример #9
0
    private void Loadcsv()
    {
        //引用输入的csv文件
        TextAsset talk = Loadtxt;

        //将每行 切割并输入到rowlist的数组
        string[] rowlist = talk.text.Split(new char[] { '\n' });
        //将每行用,切割 并根据表头创建新dict
        for (int i = 1; i < rowlist.Length - 1; i++)
        {
            string[]    row        = rowlist[i].Split(new char[] { ',' });
            TalkMessage CsvToUnity = new TalkMessage();
            int.TryParse(row[0], out CsvToUnity.id);
            CsvToUnity.talk = row[1];
            needSpeak.Add(CsvToUnity);
        }
    }
Пример #10
0
        private void _AnimatorFocusChange(TalkMessage data)
        {
            if (!data.LeftSide.HasValue)
            {
                return;
            }

            if (data.LeftSide.Value)
            {
                _UI.Animator.Left.SetBool(FOCUS_TRIGGER, true);
                _UI.Animator.Right.SetBool(FOCUS_TRIGGER, false);
            }
            else
            {
                _UI.Animator.Right.SetBool(FOCUS_TRIGGER, true);
                _UI.Animator.Left.SetBool(FOCUS_TRIGGER, false);
            }
        }
Пример #11
0
        private IEnumerator _UnSkippableEscapement(TalkMessage data)
        {
            var message   = data.Message;
            var fixedName = data.Name.Replace("(制服)", string.Empty);

            fixedName         = fixedName.Replace("ボス素顔", "???");
            _UI.Name.text     = fixedName;
            _UI.Sentence.text = string.Empty;
            yield return(null);

            float deltaTime;

            for (int i = 0; i < message.Length; i++)
            {
                deltaTime = 0.0f;
                while (deltaTime < _WaitSec)
                {
                    deltaTime += Time.deltaTime;
                    yield return(null);
                }
                _UI.Sentence.text += message[i];
                yield return(null);
            }
        }
Пример #12
0
 public void ReceiveMessage(TalkMessage talkMessage)
 {
     Message = talkMessage.WhatToSay;
 }
Пример #13
0
        private void _SetSprite(TalkMessage data)
        {
            if (data == null)
            {
                return;
            }
            var sprite = _LoadSpriteData(data.Name);

            if (sprite == null)
            {
                return;
            }
            Sprite face;

            switch (data.Face)
            {
            case Emotion.None:
                face = data.LeftSide.Value ? _UI.Character.LeftFace.sprite : _UI.Character.RightFace.sprite;
                break;

            case Emotion.Normal:
                face = sprite.Normal;
                break;

            case Emotion.Seriously:
                face = sprite.Seriously;
                break;

            case Emotion.Trouble:
                face = sprite.Trouble;
                break;

            case Emotion.Grin:
                face = sprite.Grin;
                break;

            case Emotion.Smile:
                face = sprite.Smile;
                break;

            case Emotion.Surprise:
                face = sprite.Surprise;
                break;

            case Emotion.Salute:
                face = sprite.Salute;
                break;

            default:
                face = _UI.Character.LeftFace.sprite;
                break;
            }

            if (face == null)
            {
                return;
            }

            if (data.LeftSide.Value)
            {
                if (face == sprite.Salute)
                {
                    _UI.Character.LeftBody.enabled = false;
                    _UI.Character.LeftFace.sprite  = face;
                }
                else
                {
                    _UI.Character.LeftBody.enabled = true;
                    _UI.Character.LeftFace.sprite  = face;
                    _UI.Character.LeftBody.sprite  = sprite.Body;
                }
            }
            if (!data.LeftSide.Value)
            {
                if (face == sprite.Salute)
                {
                    _UI.Character.RightBody.enabled = false;
                    _UI.Character.RightFace.sprite  = face;
                }
                else
                {
                    _UI.Character.RightBody.enabled = true;
                    _UI.Character.RightFace.sprite  = face;
                    _UI.Character.RightBody.sprite  = sprite.Body;
                }
            }
        }
Пример #14
0
 public void ReceiveTalkMessage(TalkMessage message)
 {
     Execute.OnUIThread(() => Message = message.WhatToSay);
 }