Exemplo n.º 1
0
 void Start()
 {
     counterOn         = false;
     p                 = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     day.text          = "Day: 0";
     dayBar.localScale = new Vector3(0, dayBar.localScale.y, 1);
 }
Exemplo n.º 2
0
 void Start()
 {
     p = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     //subscribes methods to onPeriodChange event and finds reference to border from hierarchy
     border = GameObject.FindGameObjectWithTag("Border").transform;
     FindObjectOfType <ScheduleHandler>().onPeriodChange += GoHome;
     FindObjectOfType <ScheduleHandler>().onPeriodChange += GoToSchool;
 }
Exemplo n.º 3
0
 void Start()
 {
     p              = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     studentT       = studentPrefab.transform;
     yearOneRatio   = 190f / 460;
     yearTwoRatio   = 140f / 460;
     yearThreeRatio = 130f / 460;
 }
Exemplo n.º 4
0
 void Start()
 {
     p          = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     simStarted = false;
     scheduleSelector.onValueChanged.AddListener(delegate
     {
         NewScheduleSelected(scheduleSelector);
     });
 }
Exemplo n.º 5
0
 void Start()
 {
     p      = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     border = GameObject.FindGameObjectWithTag("Border").gameObject.GetComponent <Transform>();
     gameObject.GetComponent <SpriteRenderer>().color = Color.yellow;
     radius          = (p.infectionRadius * border.localScale.x * 2) / p.lengthOfSide;
     checktime       = p.dayLength;
     lastCheckTime   = Time.time;
     timeOfInfection = Time.time;
     timeTillRemoved = p.timeTillRemoved;
     incubationTime  = p.incubationTime;
 }
Exemplo n.º 6
0
    void Start()
    {
        p            = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
        borderLength = GameObject.FindGameObjectWithTag("Border").
                       gameObject.GetComponent <Transform>().localScale.x * 2;
        mRidigbody = GetComponent <Rigidbody2D>();

        timeUntilNextDirChange   = 0;
        timeUntilNextSpeedChange = 0;

        timeSinceLastDirChange   = 0;
        timeSinceLastSpeedChange = 0;
    }
Exemplo n.º 7
0
    void Update()
    {
        p = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();

        //Text elements and daybar on main screen
        numberSusceptible.text = "Susceptible: " + GetStatCount("Sus").ToString();
        numberInfected.text    = "Infected: " + GetStatCount("Inf").ToString();
        numberRemoved.text     = "Removed: " + GetStatCount("Rem").ToString();
        density.text           = "Density: " + (GetStatCount("All") / Mathf.Pow(p.lengthOfSide, 2)).ToString("0.00") +
                                 " people/sqrm";


        curTSV.text = timeSlider.value.ToString("0.00") + "x";

        //text and values in settings menu
        infRateValue.text = p.infectionRate.ToString("0.00");
        attendence.text   = p.attendence.ToString("0.00");
    }
Exemplo n.º 8
0
 void Start()
 {
     p                 = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     lastCheck         = Time.time;
     timeBetweenChecks = 7 * p.dayLength;
 }
Exemplo n.º 9
0
 void Start()
 {
     mRigidBody = GetComponent <Rigidbody2D>();
     p          = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     startTime  = Time.unscaledTime;
 }
Exemplo n.º 10
0
 void Start()
 {
     p = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
 }
Exemplo n.º 11
0
 void Start()
 {
     p                 = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     lastCheck         = 0;
     daysBetweenChecks = 15;
 }
Exemplo n.º 12
0
 void Start()
 {
     p            = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     radiusActive = false;
 }