コード例 #1
0
 public void Hide()
 {
     if (state == bubbleState.there)
     {
         state = bubbleState.disappearing;
     }
 }
コード例 #2
0
 private void Appear()
 {
     gameObject.transform.localScale = HelperFuctions.ScaleVector(gameObject.transform.localScale, Time.deltaTime / minScale / scaleTime);
     if (gameObject.transform.localScale.x >= nativeScale.x)
     {
         gameObject.transform.localScale = nativeScale;
         state          = bubbleState.there;
         thereStartTime = Time.time;
     }
 }
コード例 #3
0
        private void Disappear()
        {
            gameObject.transform.localScale = HelperFuctions.ScaleVector(gameObject.transform.localScale, 1 / (Time.deltaTime / minScale / scaleTime));
            if (gameObject.transform.localScale.x <= nativeScale.x * minScale)
            {
                gameObject.transform.localScale = HelperFuctions.ScaleVector(nativeScale, minScale);
                state = bubbleState.idle;
                gameObject.SetActive(false);

                if (nextTextQueued)
                {
                    Show(nextText);
                    nextTextQueued = false;
                }
            }
        }
コード例 #4
0
 public void Show(string request)
 {
     if (state == bubbleState.idle)
     {
         requestText.text = request;
         state            = bubbleState.appearing;
         gameObject.SetActive(true);
         Debug.Log("Speechbubble coming up with text " + request);
     }
     else if (state == bubbleState.disappearing && !nextTextQueued)
     {
         nextTextQueued = true;
         nextText       = request;
     }
     else if (state == bubbleState.there)
     {
         Hide();
         Show(request);
     }
 }