void Start() { tooltip = GameObject.Find("UI").transform.Find("Tooltip").GetComponent <Tooltip>(); survivorManager = GameObject.Find("GameManager").GetComponent <SurvivorManager> (); specialisationDatabase = GameObject.Find("SpecialisationDatabase").GetComponent <SpecialisationDatabase> (); specialisation = specialisationDatabase.specialisations [specialisationId]; }
void Start() { chanceOfNewSurvivor = startingChance; survivorManager = GetComponent <SurvivorManager> (); reportManager = GetComponent <ReportManager> (); waveManager = GetComponent <WaveManager> (); waveManager.waveEndEvent += OnWaveEnd; }
void Start() { survivorManager = SurvivorManager.GetInstance(); authority = 50; daysSurvived = 0; score = 0; DeleteChoiceHUD(); StartCoroutine(dayAnnouncer.DisplayDay()); //dialogueManager = DialogueManager.GetInstance(); eventPanel.SetActive(true); CurrentAuth = maxAuth; }
void Start() { survivor = GameObject.FindGameObjectWithTag("player"); survivorManager = survivor.GetComponent<SurvivorManager>(); playerHealth = survivorManager.PlayerHealth; isPlayerDead = survivorManager.IsPlayerDead; coolDownTimer = 0; damage = -10; a = GetComponent<Animation>(); r = GetComponent<Rigidbody>(); myTransform = GetComponent<Transform>(); a.wrapMode = WrapMode.Loop; }
public bool FullCheck() { if (AuthorityCheck()) { SurvivorManager s = SurvivorManager.GetInstance(); foreach (Survivor survivor in s.Survivors) { if (MentalHealthCheck(survivor) && PhysicalHealthCheck(survivor)) { return(true); } } } return(false); }
void Start() { GameObject.Find("GameManager").GetComponent <ScoreManager> ().totalSurvivors++; livingEntity = GetComponent <LivingEntity> (); itemDatabase = GameObject.Find("Databases").transform.Find("ItemDatabase").GetComponent <ItemDatabase> (); database = GameObject.Find("SpecialisationDatabase").GetComponent <SpecialisationDatabase> (); survivorManager = GameObject.Find("GameManager").GetComponent <SurvivorManager> (); reportManager = GameObject.Find("GameManager").GetComponent <ReportManager> (); waveManager = GameObject.Find("GameManager").GetComponent <WaveManager> (); scoutManager = GameObject.Find("GameManager").GetComponent <ScoutManager> (); scoreManager = GameObject.Find("GameManager").GetComponent <ScoreManager> (); livingEntity.deathEvent += OnDeath; waveManager.waveStartEvent += OnWaveStart; waveManager.waveEndEvent += OnWaveEnd; }
void Start() { player = GameObject.Find("Player").gameObject; waveManager = GetComponent <WaveManager> (); chanceNewSurvivor = GetComponent <ChanceNewSurvivor> (); survivorManager = GetComponent <SurvivorManager> (); inventory = GetComponent <Inventory> (); specialisationDatabase = GameObject.Find("SpecialisationDatabase").GetComponent <SpecialisationDatabase> (); itemDatabase = GameObject.Find("Databases").transform.Find("ItemDatabase").GetComponent <ItemDatabase> (); playerEntity = player.GetComponent <LivingEntity> (); gameMode = PlayerPrefs.GetString("gameMode"); if (gameMode == "colony") { chanceNewSurvivor.acceptingNewSurvivor = false; specialisationDatabase.specialisations [0].pickupNearbyItems = false; for (int i = 0; i < 15; i++) { Vector3 randomPos = new Vector3(Random.Range(colonySpawn.position.x - 10f, colonySpawn.position.x + 10f), colonySpawn.position.y, Random.Range(colonySpawn.position.z - 10f, colonySpawn.position.z + 10f)); survivorManager.SpawnSurvivor(randomPos); } } else if (gameMode == "devil") { waveManager.SetWave(666); for (int i = 0; i < startingSurvivors; i++) { Vector3 randomPos = new Vector3(Random.Range(colonySpawn.position.x - 10f, colonySpawn.position.x + 10f), colonySpawn.position.y, Random.Range(colonySpawn.position.z - 10f, colonySpawn.position.z + 10f)); survivorManager.SpawnSurvivor(randomPos); } inventory.startingItemIds = startingItems; } else if (gameMode == "staying-alive") { player.GetComponent <LivingEntity> ().startingHealth = 100; chanceNewSurvivor.acceptingNewSurvivor = false; StartCoroutine(ReduceHealth()); } }
// Use this for initialization void Start() { village = Village.GetInstance(); survivorManager = SurvivorManager.GetInstance(); TextDisplay = GetComponentsInChildren <Text>(); dayDisplay = TextDisplay[0]; scoreDisplay = TextDisplay[1]; gameOverDisplay = TextDisplay[2]; gameOverCause = TextDisplay[3]; background = GetComponentInChildren <Image>(); canvasGroup = GetComponent <CanvasGroup>(); canvas = GetComponent <Canvas>(); dayDisplay.enabled = false; gameOverCause.enabled = false; gameOverDisplay.enabled = false; buttons = GetComponentsInChildren <Button>(); foreach (Button b in buttons) { b.GetComponentInChildren <Text>().enabled = false; b.enabled = false; } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } names = nameList.text.Split('\n'); for (int i = 0; i < survivorCount; i++) { string fName = names[Random.Range(0, names.Length)]; string lName = names[Random.Range(0, names.Length)]; int mHealth = Random.Range(lowerBound, upperBound); int pHealth = Random.Range(lowerBound, upperBound); int id = survivorId; survivorId++; Survivor temp = new Survivor(fName, lName, mHealth, pHealth, id); survivors.Add(temp); } }
public void Launcher() { survivors = SurvivorManager.GetInstance().Survivors; mentalChangement = SurvivorManager.GetInstance().MentalIncreaser; physicChangement = SurvivorManager.GetInstance().PhysicIncreaser; for (int i = 0; i < survivors.Count; i++) { // Instantiate several panel and change color in function of the mental/physics stats GameObject newPanel = Instantiate(panel, GetComponent <Transform>()); newPanel.GetComponent <RectTransform>().position = new Vector2(newPanel.GetComponent <RectTransform>().position.x, newPanel.GetComponent <RectTransform>().position.y - i * 90); newPanel.transform.GetChild(0).GetComponent <Text>().text = survivors[i].FirstName + ' ' + survivors[i].LastName; if (survivors[i].MentalHealth >= 0 && survivors[i].MentalHealth < 34) { newPanel.transform.GetChild(3).GetComponent <Text>().color = Color.red; } if (survivors[i].MentalHealth >= 34 && survivors[i].MentalHealth < 67) { newPanel.transform.GetChild(3).GetComponent <Text>().color = new Color(1.0F, 0.5F, 0.31F, 1.0F); } if (survivors[i].MentalHealth >= 67 && survivors[i].MentalHealth < 101) { newPanel.transform.GetChild(3).GetComponent <Text>().color = Color.green; } newPanel.transform.GetChild(3).GetComponent <Text>().text = survivors[i].MentalHealth.ToString(); if (survivors[i].MentalHealth >= 0 && survivors[i].MentalHealth < 34) { newPanel.transform.GetChild(4).GetComponent <Text>().color = Color.red; // works well } if (survivors[i].MentalHealth >= 34 && survivors[i].MentalHealth < 67) { newPanel.transform.GetChild(4).GetComponent <Text>().color = new Color(1.0F, 0.5F, 0.31F, 1.0F); } if (survivors[i].MentalHealth >= 67 && survivors[i].MentalHealth < 101) { newPanel.transform.GetChild(4).GetComponent <Text>().color = Color.green; } newPanel.transform.GetChild(4).GetComponent <Text>().text = survivors[i].PhysicalHealth.ToString(); // New mental statistics added if (survivors[i].MentalChangement != 0) { if (survivors[i].MentalChangement > 0) { newPanel.transform.GetChild(5).GetComponent <Text>().color = Color.green; newPanel.transform.GetChild(5).GetComponent <Text>().text = "+" + survivors[i].mentalChange.ToString(); } else { if (survivors[i].MentalChangement < 0) { newPanel.transform.GetChild(5).GetComponent <Text>().color = Color.red; newPanel.transform.GetChild(5).GetComponent <Text>().text = survivors[i].mentalChange.ToString(); } } } else { newPanel.transform.GetChild(5).GetComponent <Text>().color = Color.green; newPanel.transform.GetChild(5).GetComponent <Text>().text = "+" + survivors[i].mentalChange.ToString(); } // New physics statistics added if (survivors[i].PhysicalChangement != 0) { if (survivors[i].PhysicalChangement > 0) { newPanel.transform.GetChild(6).GetComponent <Text>().color = Color.green; newPanel.transform.GetChild(6).GetComponent <Text>().text = "+" + survivors[i].physicalChange.ToString(); } else { if (survivors[i].PhysicalChangement < 0) { newPanel.transform.GetChild(6).GetComponent <Text>().color = Color.red; newPanel.transform.GetChild(6).GetComponent <Text>().text = survivors[i].physicalChange.ToString(); } } } else { newPanel.transform.GetChild(6).GetComponent <Text>().color = Color.green; newPanel.transform.GetChild(6).GetComponent <Text>().text = "+" + survivors[i].physicalChange.ToString(); } } }
// Use this for initialization void Start() { survivorManager = SurvivorManager.GetInstance(); tabTente = GetComponentsInChildren <Transform>(); }
public void Init(ContentManager content) { isRunning = false; soundMgr = DayGameEngineImp.getGameEngine().getSoundManager(); uiMgr = new NightUiManagerImpl(); menuMgr = DayGameEngineImp.getGameEngine().getMenuManager(); mapMgr = DayGameEngineImp.getGameEngine().getMapManager(); zombieMgr = new ZombieManagerImplementation(); effectsMgr = new EffectsManagerImp(); survivorMgr = new SurvivorManagerIMP(); nightSimMgr = new NightSimMgrImpl(); nightSimMgr.init(); effectsMgr.Init(content); //uiMgr.init(); //menuMgr.Init(content); // gets init in the daygameengine //mapMgr.Init(); zombieMgr.init(content); survivorMgr.init(content); nightview = content.Load<Texture2D>("Images//nightclouds"); }