public void DisplayText()
 {
     if (!showingText)
     {
         textField.StartCoroutine(ShowText());
         showingText = true;
     }
 }
Example #2
0
 public static void TypeText(Text textElement, string text, float time)
 {
     TutorialManager.typing = true;
     float characterDelay = time / text.Length;
     SetText = typeWriter(textElement, text, characterDelay);
     textElement.StartCoroutine(SetText);
 }
Example #3
0
    private void OnCollisionEnter(Collision collision)
    {
        if (hasShownMeasurement == false)
        {
            if (interacted && !item.attachedToHand)
            {
                if (collision.impulse.magnitude > minMagnitude)
                {
                    float distance = Vector3.Distance(Camera.main.transform.position, this.transform.position);
                    if (distance > minDistance)
                    {
                        hasShownMeasurement = true;

                        float distanceFt = distance * 3.28084f;

                        GameObject measurement = GameObject.Instantiate(measurementPrefab);
                        Text       text        = measurement.GetComponentInChildren <Text>();
                        text.text = string.Format("{0:0.0}m\n{1:0.0}ft", distance, distanceFt);

                        Destroy(measurement, destroyAfterTime);

                        text.StartCoroutine(DoRaise(measurement, this.transform.position));
                    }
                }
            }
        }
    }
Example #4
0
    public static void Update(List <Image> nummbers, int score, int plusPoint, Text plusView)
    {
        if (plusPoint == 0)
        {
            return;
        }
        plusView.gameObject.SetActive(true);
        if (plusPoint <= 0)
        {
            plusView.color = _downPoint;
        }
        else
        {
            plusView.color = _upPoint;
        }
        plusView.text += plusPoint.ToString("+#;-#;");
        var _save = score + plusPoint;

        if (_save <= 0)
        {
            _save = 0;
        }
        if (_save >= 9999)
        {
            _save = 9999;
        }
        plusView.StartCoroutine(ViewUpdate(plusView.gameObject, _save, nummbers));
    }
Example #5
0
 public static void CountToInt(this Text TF, int from, int to, float time)
 {
     TF.StartCoroutine(CountTo(from, to, Mathf.Max(0, time), counted => { if (TF != null)
                                                                          {
                                                                              TF.text = counted.ToString();
                                                                          }
                               }));
 }
Example #6
0
    public static void TypeText(Text textElement, string text, float time)
    {
        TutorialManager.typing = true;
        float characterDelay = time / text.Length;

        SetText = typeWriter(textElement, text, characterDelay);
        textElement.StartCoroutine(SetText);
    }
Example #7
0
    static IEnumerator FadeTextSequence(Text t, int cycles, Color Color1, Color Color2, float time1, float time2)
    {
        int m_cycles = cycles;

        while (cycles <= 0 || m_cycles >= 0)
        {
            yield return(t.StartCoroutine(FadeTextOnce(t, Color1, time1)));

            m_cycles--;
            if (cycles <= 0 || m_cycles > 0)
            {
                yield return(t.StartCoroutine(FadeTextOnce(t, Color2, time2)));
            }
            m_cycles--;
            yield return(null);
        }
    }
Example #8
0
 void ShowScore()
 {
     if (scoreLabel != null)
     {
         scoreLabel.gameObject.SetActive(true);
         scoreLabel.text = "Score: " + score + "/" + index;
         scoreLabel.StartCoroutine(HideScore());
     }
 }
Example #9
0
    public static void TypeText(GameObject textElementObject, string text, float time, AudioClip typeSound)
    {
        //print ("typing WITH sound");
        float characterDelay = time;
        Text  textElement    = textElementObject.GetComponent <Text> ();

        textElement.text = "";         //wipe text
        textElementObject.SetActive(true);
        textElement.StartCoroutine(SetText(textElementObject, text, characterDelay, typeSound));
    }
Example #10
0
    public static void TypeText(GameObject textElementObject, string text, float time)
    {
        //print ("typing without sound");
        //float characterDelay = time / text.Length;	//time to type whole sentence
        float characterDelay = time;                                            //characters per second
        Text  textElement    = textElementObject.GetComponent <Text> ();

        textElement.text = "";         //wipe text
        textElement.StartCoroutine(SetText(textElementObject, text, characterDelay));
    }
Example #11
0
        /// <summary>
        /// Отправить сообщение <paramref name="message"/> игроку,
        /// котрое будет отображаться <paramref name="waitSeconds"/> секунд
        /// </summary>
        /// <param name="message">Сообщение для игрока</param>
        /// <param name="waitSeconds">Время, в течение которого будет отображаться сообщение</param>
        public void SendMessageToPlayer(string message, float waitSeconds = 3f)
        {
            InitMessageToPlayer();

            if (messageToPlayer == null)
            {
                return;
            }

            if (currentCoroutine != null)
            {
                messageToPlayer.StopCoroutine(currentCoroutine);
            }

            currentCoroutine = messageToPlayer.StartCoroutine(SendMessageToPlayerCoroutine(message, waitSeconds));
        }
 public void StartLoadingFeedbackAnimation()
 {
     _animatedFeedbackText.StartCoroutine(LoadingAnimation());
 }
Example #13
0
 internal FizzleSubtitle(Component subtitleTransform)
 {
     subtitle    = subtitleTransform.GetComponent <Text>();
     stringQueue = new Queue <SubtitlePair>();
     subtitle.StartCoroutine(InitSubtitle());
 }
Example #14
0
 public static void CountScore(Text textElement, int score, int scoreAdded, float time, int countAdded)
 {
     SetScore = scoreCounter (textElement, score, scoreAdded, time, countAdded);
     textElement.StartCoroutine (SetScore);
 }
Example #15
0
 public static void FadeText(Text t, int cycles, Color Color1, Color Color2, float time1, float time2)
 {
     t.StartCoroutine(FadeTextSequence(t, cycles, Color1, Color2, time1, time2));
 }