void TaskOnClick() { this.gameObject.SetActive(false); if (ShowSymptome) { Main_Controller_def.ResearchSympButton(data[dropdown.value]); } else { Main_Controller_def.ResearchTransButton(data[dropdown.value]); } }
public static void OnRpcOnSpellUsedCallbackRegion(string msg, string value) { Debug.Log(value); switch (msg) { case "RandomEvent": eventsList [int.Parse(value)].ApplyChanges(); eventsList.Remove(eventsList [int.Parse(value)]); break; case "NewRegionInfected": Country region = GetCountryFromName(value); region.infected += 1; region.Population -= 1; break; case "CloseBorder": Main_Controller_def.CloseBorder(GetCountryFromName(value)); break; case "Localisation": Instance.OpenNotification("Recherche positive: L'adversaire a trouvé le virus ! ", value + " est une région contenant au moins une personne infectée."); Main_Controller_def.Localisation(GetCountryFromName(value)); break; case "ResearchSymp": //FIXME Main_Controller_def.ResearchSymp(value); break; case "ResearchTrans": //FIXME Main_Controller_def.ResearchTrans(value); break; case "SanitaryCampaign": Main_Controller_def.SanitaryCampaign(GetCountryFromName(value)); break; case "RegionSelected": isStarted = true; StartRegion = GetCountryFromName(value); break; default: Debug.Log("WTF?"); break; } }
public static void OnRpcOnSpellUsedCallbackRegion(string msg, string value) { Debug.Log(value); switch (msg) { case "RandomEvent": eventsList [int.Parse(value)].ApplyChanges(); eventsList.Remove(eventsList [int.Parse(value)]); break; case "NewRegionInfected": Country region = GetCountryFromName(value); region.infected += 1; region.Population -= 1; break; case "CloseBorder": Main_Controller_def.CloseBorder(GetCountryFromName(value)); break; case "Localisation": Main_Controller_def.Localisation(GetCountryFromName(value)); break; case "ResearchSymp": //FIXME Main_Controller_def.ResearchSymp(value); break; case "ResearchTrans": //FIXME Main_Controller_def.ResearchTrans(value); break; case "SanitaryCampaign": Main_Controller_def.SanitaryCampaign(GetCountryFromName(value)); break; case "RegionSelected": isStarted = true; StartRegion = GetCountryFromName(value); break; default: Debug.Log("WTF?"); break; } }
public static void OnRpcOnSpellUsedCallback(string msg) { switch (msg) { //def case "ResHum": Main_Controller_off.ResHum(); break; case "ResTemp": Main_Controller_off.ResTemp(); break; case "Res": Main_Controller_off.Res(); break; case "Sneezing": Main_Controller_off.Sneezing(); break; case "Cough": Main_Controller_off.Cough(); break; case "SoreThroat": Main_Controller_off.SoreThroat(); break; case "HeartFailure": Main_Controller_off.HeartFailure(); break; case "Diarrhea": Main_Controller_off.Diarrhea(); break; case "Fever": Main_Controller_off.Fever(); break; case "Nausea": Main_Controller_off.Nausea(); break; case "ResearchAntidote": Main_Controller_def.ResearchAntidote(); break; case "Boost": Main_Controller_def.Boost(); break; case "VaccinateAnimals": Main_Controller_def.VaccinateAnimals(); break; case "BetterHygiene": Main_Controller_def.BetterHygiene(); break; case "HighDensityRes": Main_Controller_off.HighDensityRes(); break; case "Depression": Main_Controller_off.Depression(); break; case "Flu": Main_Controller_off.Flu(); break; case "Insomnia": Main_Controller_off.Insomnia(); break; case "Stroke": Main_Controller_off.Stroke(); break; case "Paralisys": Main_Controller_off.Paralisys(); break; case "AttackAnimals": Main_Controller_off.AttackAnimals(); break; default: Debug.Log("WTF?"); break; } }
private void FixedUpdate() { if (!canStart) { canStart = Main_Controller.symptoms.Count != 0 || Main_Controller.transmitions.Count != 0; return; } if (i != 450) { i++; return; } i = 0; if (!located) { located = Main_Controller_def.Localisation( Main_Controller.Earth.regionlist[Random.Range(0, Main_Controller.symptoms.Count)]); } else { Main_Controller_def.ResearchAntidote(); if (Main_Controller.transmitions.Count != 0) { if (Main_Controller.symptoms.Count != 0 && !Main_Controller_def.ResearchTrans(Main_Controller.transmitions[Random.Range(0, Main_Controller.transmitions.Count)])) { Main_Controller_def.ResearchSymp(Main_Controller.symptoms[Random.Range(0, Main_Controller.symptoms.Count)]); } } } if (Main_Controller_def.foundSymptoms.Count == Main_Controller.symptoms.Count) { if (Main_Controller_def.foundTransmitions.Count == Main_Controller.transmitions.Count) { text.text = "L'IA recherche l'antidote"; } else { text.text = "L'IA a recherché tous les symptomes"; } } else { Debug.Log("trans found : " + Main_Controller_def.foundTransmitions.Count + "trans: " + Main_Controller.transmitions.Count); Debug.Log("symp found : " + Main_Controller_def.foundSymptoms.Count + "symp: " + Main_Controller.symptoms.Count); if (Main_Controller_def.foundTransmitions.Count == Main_Controller.transmitions.Count) { text.text = "L'IA a recherché toutes les transmitions"; } else { if (located) { text.text = "L'IA a localisé le virus"; } else { text.text = "L'IA tente de localiser le virus"; } } } }
public static Main_Controller_def Instance; //for notification,see https://answers.unity.com/questions/753488/error-an-object-reference-is-required-to-access-no-2.html void Awake() { Instance = this; GameObject notif = GameObject.Find("Notifications"); }