public void Start() { _current = this; AllSurvivorsDead = false; AllSurvivorsEscaped = false; ExitGatesPowered = false; Trial = new Trial(5, 5); Player = new Survivor("You"); Player.IsLocalPlayer = true; Survivors = new List <Survivor>() { new Survivor("Nancy"), new Survivor("Dwight"), new Survivor("Meg"), new Survivor("Zaria") }; Killer = new Killer("The Wraith"); var brain = new Brain(BrainStateType.WANDER); brain.Control(Killer); Player.AddPerk(new SprintBurstPerk()); Trial.Spawn(Player); Trial.Spawn(Killer); foreach (var survivor in Survivors) { var survivorBrain = new Brain(BrainStateType.WANDER); survivorBrain.Control(survivor); Trial.Spawn(survivor); } eventUI = new EventUI(); perkUI = new PerkUI(); inputUI = new InputUI(); minimapUI = new MinimapUI(); repairUI = new RepairUI(); UIManager.Add(eventUI); UIManager.Add(perkUI); UIManager.Add(inputUI); UIManager.Add(minimapUI); UIManager.Add(repairUI); repairUI.Visible = false; inputUI.Input.OnInput = (text) => { ProcessInput(text); }; GameLoopThread = new Thread(new ThreadStart(Update)); GameLoopThread.IsBackground = true; GameLoopThread.Start(); }
private void Awake() { repairTimer = 7f; controller = GameObject.Find("Controller"); MainUI.SetActive(true); RepairUI.SetActive(false); FallUI.SetActive(false); }
private void Update() { if (controller.GetComponent <GameManager>().isBroken == false) { MetrsChecker(); } if (controller.GetComponent <GameManager>().isBroken) { MainUI.SetActive(false); RepairUI.SetActive(false); FallUI.SetActive(true); GameOver.SetActive(false); } else { RepairUI.SetActive(false); } if (controller.GetComponent <GameManager>().isRepair) { MainUI.SetActive(false); RepairUI.SetActive(true); FallUI.SetActive(false); GameOver.SetActive(false); Timer(); } if (controller.GetComponent <GameManager>().isGameOver) { MainUI.SetActive(false); RepairUI.SetActive(false); FallUI.SetActive(false); GameOver.SetActive(true); } if (repairTimer <= 0) { if (oneMore) { controller.GetComponent <GameManager>().TimerEndFunction(); oneMore = false; repairTimer = 7f; } oneMore = true; } }