Пример #1
0
    private void Resolocation()
    {
        string s = sp.ReadLine();

        s = s.Substring(s.IndexOf('i') + 1, s.IndexOf(';') - s.IndexOf('i') - 1);
        int f = (Convert.ToInt32(s));

        text1.text = f.ToString();
        if (f > 1260)
        {
            f = 1260;
        }
        int n = f / 60;

        if (n >= 0)
        {
            if (n <= 21)
            {
                for (int i = 0; i < n; i++)
                {
                    lamp1[i].SetActive(true);
                }
                if (n < 21)
                {
                    for (int i = n; i < 21; i++)
                    {
                        lamp1[i].SetActive(false);
                    }
                }
            }
        }
    }
Пример #2
0
    private void Resolocation()
    {
        {
            string s = sp.ReadLine();

            s = s.Substring(s.IndexOf('v') + 1, s.IndexOf(';') - s.IndexOf('v') - 1);
            f = (float.Parse(s) / 100);
            shkala.transform.rotation = Quaternion.Euler(0, 0, -f * 2.5f);

            text.text = (f.ToString());
        }
    }
Пример #3
0
    private void Resolocation()
    {
        {
            string s = sp.ReadLine();

            s = s.Substring(s.IndexOf("t") + 1, s.IndexOf(";") - s.IndexOf("t") - 1);
            f = (float.Parse(s) / 100);
            shkala.transform.position   = Vector3.Lerp(shkala.transform.position, new Vector3(shkala.transform.position.x, (-2.68f + (f * 0.05f) / 2), shkala.transform.position.z), 0.1f);
            shkala.transform.localScale = new Vector3(shkala.transform.localScale.x, 4.6737f + (f * 0.09096f) / 2, shkala.transform.localScale.z);
            text.text = (Mathf.Round(f)).ToString();
            if ((f < 20.5) && (f > 19.5) && (k == 1))
            {
                CancelInvoke("Resolocation");
                sp.Close();
                girl.GetComponent <Animator>().Play("speak 5");
                if (!source.isPlaying)
                {
                    source.clip = audioo[3];
                    source.Play();
                    sound_3 = false;
                }
            }
            if ((f < 15.5) && (f > 14.5) && (k == 2))
            {
                CancelInvoke("Resolocation");
                sp.Close();
                girl.GetComponent <Animator>().Play("speak 9");
                if (!source.isPlaying)
                {
                    source.clip = audioo[4];
                    source.Play();
                    sound_4 = false;
                }
            }
            if ((f < 30.5) && (f > 29.5) && (k == 3))
            {
                CancelInvoke("Resolocation");
                sp.Close();
                girl.GetComponent <Animator>().Play("speak 9");
                if (!source.isPlaying)
                {
                    source.clip = audioo[5];
                    source.Play();
                    sound_5 = false;
                }
            }
            if ((f > 13.5) && (f < 14.5) && (k == 4))
            {
                CancelInvoke("Resolocation");
                sp.Close();
                girl.GetComponent <Animator>().Play("speak 8");
                if (!source.isPlaying)
                {
                    source.clip = audioo[6];
                    source.Play();
                    sound_6 = false;
                }
            }
            if ((f < 30.5) && (f > 29.5) && (k == 5))
            {
                CancelInvoke("Resolocation");
                sp.Close();
                girl.GetComponent <Animator>().Play("speak 15");
                Fish.GetComponent <Animator>().Play("hot");
                if (!source.isPlaying)
                {
                    source.clip = audioo[8];
                    source.Play();
                }
            }
            if ((f < 25.5) && (f > 21.5) && (k == 6))
            {
                CancelInvoke("Resolocation");
                sp.Close();
                girl.GetComponent <Animator>().Play("speak 19");
                Fish.GetComponent <Animator>().Play("happy");
                if (!source.isPlaying)
                {
                    source.clip = audioo[11];
                    source.Play();
                }
            }
            if ((k == 7) || (k == 8) || (k == 9))
            {
                if (f - chea1 <= 0.2f)
                {
                    CancelInvoke("Resolocation");
                    sp.Close();
                    p++;
                    if (!source.isPlaying)
                    {
                        source.clip = audioo[13 + p];
                        source.Play();
                    }
                    girl.GetComponent <Animator>().Play("speak 33");
                    FishAnim(f);
                }
                else
                {
                    Invoke("chea", 0.7f);
                }
            }
        }
    }