Exemple #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);
 }
Exemple #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;
 }
 void Start()
 {
     p              = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     studentT       = studentPrefab.transform;
     yearOneRatio   = 190f / 460;
     yearTwoRatio   = 140f / 460;
     yearThreeRatio = 130f / 460;
 }
Exemple #4
0
 void Start()
 {
     p          = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     simStarted = false;
     scheduleSelector.onValueChanged.AddListener(delegate
     {
         NewScheduleSelected(scheduleSelector);
     });
 }
Exemple #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;
 }
Exemple #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;
    }
    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");
    }
Exemple #8
0
 void Start()
 {
     p                 = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     lastCheck         = Time.time;
     timeBetweenChecks = 7 * p.dayLength;
 }
Exemple #9
0
 void Start()
 {
     mRigidBody = GetComponent <Rigidbody2D>();
     p          = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     startTime  = Time.unscaledTime;
 }
 void Start()
 {
     p = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
 }
Exemple #11
0
 void Start()
 {
     p                 = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     lastCheck         = 0;
     daysBetweenChecks = 15;
 }
 void Start()
 {
     p            = GameObject.FindObjectOfType <InfectionParameters>().GetComponent <InfectionParameters>();
     radiusActive = false;
 }