Exemplo n.º 1
0
        private void CreateSpeechBubble(IEntity entity, SpeechBubbleData speechData)
        {
            var bubble = SpeechBubble.CreateSpeechBubble(speechData.Type, speechData.Message, entity, _eyeManager, this);

            if (_activeSpeechBubbles.TryGetValue(entity.Uid, out var existing))
            {
                // Push up existing bubbles above the mob's head.
                foreach (var existingBubble in existing)
                {
                    existingBubble.VerticalOffset += bubble.ContentHeight;
                }
            }
            else
            {
                existing = new List <SpeechBubble>();
                _activeSpeechBubbles.Add(entity.Uid, existing);
            }

            existing.Add(bubble);
            _speechBubbleRoot.AddChild(bubble);

            if (existing.Count > SpeechBubbleCap)
            {
                // Get the oldest to start fading fast.
                var last = existing[0];
                last.FadeNow();
            }
        }
Exemplo n.º 2
0
    private SpeechBubbleData OpenBubbleMessage(PlayerControler playerControler, string message)
    {
        SpeechBubbleData speechBubble = Instantiate(speechBubblePrefab, CanvasManager.Instance.panelMenu.transform).GetComponent <SpeechBubbleData>();

        speechBubble.text.text            = message;
        speechBubble.mCamera              = Camera.main;
        speechBubble.playerTransform      = playerControler.transform;
        speechBubble.transform.localScale = Vector3.forward;
        speechBubble.Inflate(maxSize, inflationSpeed);
        return(speechBubble);
    }
Exemplo n.º 3
0
 private void CloseBubbleMessage(SpeechBubbleData speechBubble)
 {
     speechBubble.Deflate(inflationSpeed);
 }
Exemplo n.º 4
0
 private void ChangeBubbleMessage(SpeechBubbleData speechBubble, string newMessage)
 {
     speechBubble.ChangeMessage(newMessage);
 }