Beispiel #1
0
    public void MyStart()
    {
        virusPopperPool = new List <GameObject>();
        virus           = new Virus("Hepy", 0.5f);
        perkGenerator   = new PerkGenerator();
        perkGenerator.GeneratePerks(out Symptom[] symptoms, out Transmission[] transmissions);
        Virus.CalculateSpreading(virus);

        virus.MySymptoms.AddRange(symptoms);
        virus.MyTransmissions.AddRange(transmissions);

        if (text != null)
        {
            text.text = virus.ToString();
        }
        if (_VirusUI != null)
        {
            _VirusUI.SetVirus(virus, perkGenerator);
        }

        foreach (RegionBehaviour regionBehaviour in RegionBehaviour.Regions)
        {
            regionBehaviour.SubscribeOnInfected(() =>
            {
                GetPopper().GetComponent <VirusPopper>().Pop(regionBehaviour);
            });
        }
    }
    public void SetVirus(Virus virus, PerkGenerator perkGenerator)
    {
        this.perkGenerator     = perkGenerator;
        MyVirus                = virus;
        PlagueName.text        = virus.Name;
        PlagueDescription.text = virus.ToString();

        UpdateTree();
    }