示例#1
0
    void Start()
    {
        scale = GameObject.Find("Scale");
        sim   = gameObject.AddComponent <SpiroSim>() as SpiroSim;

        //player = GameObject.Find("Player");

        //anim = player.GetComponent<Animator>();

        if (scale != null)
        {
            initialVector   = transform.position - scale.transform.position;
            initialVector.y = 0;
        }

        allThings = FindObjectsOfType <TextMeshProUGUI>();
        foreach (TextMeshProUGUI value in allThings)
        {
            if (value.name == "Pressure")
            {
                pressureText = value;
                break;
            }
        }
    }
示例#2
0
    public void dropChange(int selection)
    {
        SpiroSim simulated = gameObject.AddComponent(typeof(SpiroSim)) as SpiroSim;

        JumpForce = 50;

        string m_Path = Application.dataPath;

        File.WriteAllText(m_Path + "/RecentBreath.txt", string.Empty);

        List <int> vol  = new List <int>();
        List <int> flow = new List <int>();

        //File.WriteAllText(m_Path + "/Scripts/RecentBreath.txt", string.Empty);

        drop.value   = 0;
        drop.enabled = false;
        started      = true;
        start_time   = System.DateTime.Now;
        selection    = selection - 1;
        if (selection == 0)
        {
            simulated.StartBadBreath();
            Invoke("values", 11);
        }
        else if (selection == 1)
        {
            simulated.StartPoorerBreath();
            Invoke("values", 11);
        }
        else if (selection == 2)
        {
            simulated.StartPoorBreath();
            Invoke("values", 11);
        }
        else if (selection == 3)
        {
            simulated.StartGoodBreath();
            Invoke("values", 11);
        }
        else if (selection == 4)
        {
            simulated.StartBetterBreath();
            Invoke("values", 11);
        }
        else if (selection == 5)
        {
            simulated.StartBestBreath();
            Invoke("values", 11);
        }
    }