public static void LateUpdate() { if (!SpecCam.show) { BlackScreen.SetActive(false); return; } if (SpecCam.mode == 0) { SpecCam.FreeCam(); } else if (SpecCam.mode == 1) { SpecCam.FPCam(); } if (Input.GetKeyUp(KeyCode.Mouse1) && ScoreBoard.gamemode != 3) { if (SpecCam.mode == 0) { SpecCam.SetFPCam(); } else { SpecCam.mode = 0; GameObject gameObject = GameObject.Find("WeaponCamera"); gameObject.GetComponent <Camera>().cullingMask = 0; } } PlayerControll.CheckVisible(); if (SpecCam.mode == 1 && SpecCam.FID >= 0) { PlayerControll.vps[SpecCam.FID] = false; PlayerControll.vp[SpecCam.FID] = false; } }
IEnumerator ExitToMenu() { GameOverMenu.SetActive(false); BlackScreen.SetActive(true); while (BlackScreenRenderer.material.color.a < 1) { BlackScreenRenderer.material.color = new Color(0, 0, 0, BlackScreenRenderer.material.color.a + 0.05f); yield return(new WaitForSeconds(0.01f)); } SceneManager.LoadScene(0); }
public IEnumerator GameOverMenuFunction(bool Highest) { BlackScreen.SetActive(true); while (BlackScreenRenderer.material.color.a < 1) { BlackScreenRenderer.material.color = new Color(0, 0, 0, BlackScreenRenderer.material.color.a + 0.05f); yield return(new WaitForSeconds(0.025f)); } GameOverScoreText.text = "Your Score: " + GCS.Score.ToString(); if (Highest) { GameOverScoreText.text += "\n New Highest Score!"; } EventSystem.current.SetSelectedGameObject(GameOverButtons[0].gameObject); GameOverButtons[0].OnSelect(null); GameOverMenu.SetActive(true); }
void Start() { BlackScreen.SetActive(false); Fail0.SetActive(false); Fail1.SetActive(false); m_initialPopulation = Population; CurrentYearText.text = "Year: " + CurrentYear.ToString(); PopulationText.text = "Population: " + Population.ToString(); TotalSoulsText.text = "Souls: " + TotalSouls.ToString(); GrowthRateText.text = GrowthRate.ToString(); InvokeRepeating("TimeTick", 0.0f, 1.0f); InvokeRepeating("PopulationGrowth", 0.0f, 1.0f); //Debug.Log(CalculatePopGrowth(m_initialPopulation, 5)); }
void GameOver() { if (Population == 1) { Fail1.SetActive(true); BlackScreen.SetActive(true); } else { Fail0.SetActive(true); BlackScreen.SetActive(true); } foreach (GameObject i in Deactivateable) { i.SetActive(false); } }
private static void FreeCam() { if (SpecCam.forcechasecam == 1 && (BasePlayer.team == 0 || BasePlayer.team == 1)) { BlackScreen.SetActive(true); } else { BlackScreen.SetActive(false); } if (Input.GetKey(vp_FPInput.control[4])) { SpecCam.speed = 15; } else { SpecCam.speed = 7; } if (Input.GetKey(vp_FPInput.control[1])) { SpecCam.position += Camera.main.transform.right * -1f * (float)SpecCam.speed * Time.deltaTime; } if (Input.GetKey(vp_FPInput.control[2])) { SpecCam.position += Camera.main.transform.forward * -1f * (float)SpecCam.speed * Time.deltaTime; } if (Input.GetKey(vp_FPInput.control[3])) { SpecCam.position += Camera.main.transform.right * (float)SpecCam.speed * Time.deltaTime; } if (Input.GetKey(vp_FPInput.control[0])) { SpecCam.position += Camera.main.transform.forward * (float)SpecCam.speed * Time.deltaTime; } if (Input.GetKey(vp_FPInput.control[5])) { SpecCam.position += Camera.main.transform.up * (float)SpecCam.speed * Time.deltaTime; } if (Input.GetKey(vp_FPInput.control[6])) { SpecCam.position += Camera.main.transform.up * -1f * (float)SpecCam.speed * Time.deltaTime; } Camera.main.transform.position = SpecCam.position; }
private IEnumerator _Arrest(string nivel) { BlackScreen.SetActive(false); yield return(new WaitForSeconds(1)); cardTmp = Instantiate(Cards[nivel]) as GameObject; animTmp = Instantiate(Anim) as GameObject; img = cardTmp.GetComponent <SpriteRenderer>(); StartCoroutine("CardFadeIn"); cardTmp.transform.position = Camera.main.transform.position + new Vector3(0, 0, 20); // animTmp.transform.position = currentCamera.transform.position; animTmp.transform.localPosition = Camera.main.transform.position + new Vector3(-12.92f, 9.41f, 40); cardTmp.transform.localScale = new Vector3(1.41f, 1.41f, 1.41f); BlackScreen.transform.position = Camera.main.transform.position + new Vector3(0, 0, 20); BlackScreen.SetActive(true); yield return(new WaitForSeconds(0.5f)); audiosWin[Random.Range(0, audiosWin.Length)].Play(); StartCoroutine(DestroyCardAndAnim(cardTmp, animTmp, AuxIndex[nivel])); }
private void Awake() { Application.runInBackground = true; BlackScreen.SetActive(false); Zombie.SetInfectedScreen(false); GUI2.Init(); TEX.Init(); SND.Init(); PlayerControll.Init(); WeaponData.Init(); BasePlayer.Init(); EntControll.Init(); this.goGUI = GameObject.Find("GUI"); this.goGUI.GetComponent <global::Console>().PostAwake(); this.goGUI.GetComponent <Crosshair>().PostAwake(); this.goGUI.GetComponent <HUD>().PostAwake(); this.goGUI.GetComponent <ChooseTeam>().PostAwake(); this.goGUI.GetComponent <ScoreBoard>().PostAwake(); this.goGUI.GetComponent <Chat>().PostAwake(); this.goGUI.GetComponent <ScoreTop>().PostAwake(); this.goGUI.GetComponent <Award>().PostAwake(); this.goGUI.GetComponent <PlayerNames>().PostAwake(); this.goGUI.GetComponent <Message>().PostAwake(); this.goGUI.GetComponent <Indicator>().PostAwake(); this.goGUI.GetComponent <BuyMenu>().PostAwake(); this.goGUI.GetComponent <EscapeMenu>().PostAwake(); this.goGUI.GetComponent <Vote>().PostAwake(); this.goGUI.GetComponent <C4>().PostAwake(); this.goGUI.GetComponent <MenuBanList>().PostAwake(); this.goGUI.GetComponent <BlackScreen>().PostAwake(); this.goGUI.GetComponent <Zombie>().PostAwake(); this.goPlayer = GameObject.Find("LocalPlayer"); this.goPlayer.GetComponent <HitSound>().PostAwake(); this.goPlayer.GetComponent <HitEffect>().PostAwake(); this.goCore = GameObject.Find("Core"); this.goCore.GetComponent <UDPClient>().PostAwake(); this.goCore.GetComponent <Client>().PostAwake(); base.SendMessage("PostAwake"); base.StartCoroutine("autostart"); RenderSettings.fog = false; }
public static void Spawn(float x, float y, float z, float angle) { GameObject gameObject = GameObject.Find("LocalPlayer"); vp_FPCamera vp_FPCamera = (vp_FPCamera)UnityEngine.Object.FindObjectOfType(typeof(vp_FPCamera)); vp_FPController vp_FPController = (vp_FPController)UnityEngine.Object.FindObjectOfType(typeof(vp_FPController)); gameObject.transform.position = new Vector3(x, y, z); vp_FPCamera.SetRotation(new Vector2(0f, angle), true, true); ChooseTeam.SetActive(false); vp_FPCamera.SetMouseFreeze(false); vp_FPController.m_CharacterController.enabled = true; BasePlayer.health = 100; Crosshair.SetActive(true); Crosshair.forceLockCursor = true; HUD.SetActive(true); HUD.cs.OnResize(); BasePlayer.deadflag = 0; if (Client.ID != -1) { PlayerControll.Player[Client.ID].DeadFlag = 0; } vp_FPInput.cs.AllowGameplayInput = true; BasePlayer.selectedGrenade = 0; vp_FPInput.grenadeThrowStarting = false; vp_FPInput.grenadeThrowEnding = false; vp_FPInput.fastGrenade = false; vp_FPInput.mouseDown = false; vp_FPInput.mouseUp = false; if (GameData.restartroundmode != 1 && ScoreBoard.gamemode != 0) { vp_FPWeapon.RemoveAllMapWeapon(); vp_FPWeapon.RemoveAllMapSmoke(); } CutoffFX.RemoveFX(); vp_FPCamera.cs.SetFlashFX(0f, 3.5f); BlackScreen.SetActive(false); Zombie.SetInfectedScreen(false); Zombie.repelVector = Vector2.zero; if (Client.ID != -1) { PlayerControll.Player[Client.ID].bomb = false; } if (Client.ID != -1) { PlayerControll.Player[Client.ID].defuse = false; } ScoreTop.UpdateData(); if (BasePlayer.weapon[0] == null) { BasePlayer.weapon[0] = null; } else { BasePlayer.weapon[0] = new CWeapon(WeaponData.GetData(BasePlayer.weapon[0].data.wid)); } if (BasePlayer.weapon[1] == null) { BasePlayer.weapon[1] = new CWeapon(WeaponData.GetData(1)); } else { BasePlayer.weapon[1] = new CWeapon(WeaponData.GetData(BasePlayer.weapon[1].data.wid)); } if (BasePlayer.weapon[2] == null) { BasePlayer.weapon[2] = new CWeapon(WeaponData.GetData(28)); } BasePlayer.weapon[3] = null; if (BasePlayer.weapon[4] == null) { BasePlayer.weapon[4] = null; } BasePlayer.weapon[5] = null; BasePlayer.weapon[6] = null; if (BasePlayer.weapon[7] == null) { BasePlayer.weapon[7] = new CWeapon(WeaponData.GetData(31)); } if (BasePlayer.weapon[9] == null) { BasePlayer.weapon[9] = new CWeapon(WeaponData.GetData(26)); } BasePlayer.currweapon = null; BasePlayer.CalcAmmo(); vp_FPWeaponHandler.cs.m_CurrentWeaponID = 0; if (BasePlayer.weapon[0] != null) { vp_FPInput.cs.Player.SetWeaponByName.Try(BasePlayer.weapon[0].data.selectName); } else if (BasePlayer.weapon[1] != null) { vp_FPInput.cs.Player.SetWeaponByName.Try(BasePlayer.weapon[1].data.selectName); } else if (BasePlayer.weapon[2] != null) { vp_FPInput.cs.Player.SetWeaponByName.Try(BasePlayer.weapon[2].data.selectName); } BasePlayer.lastdroppeduid = -1; BuyMenu.ShowBuy(x, y, z); HitEffect.Reset(); SpecCam.SetActive(false); DeadCam.SetActive(false); DeadCam.setspectime = 0f; Message.ResetMessage(); HUD.ResetRespawnBar(); Award.lastaward = 0; global::Console.cs.Command("hud 1"); HUD.PlayStop(); Message.SetDead(false); PlayerNames.hideradar = false; C4.GetPlants(); C4.isplanting = false; C4.isdiffusing = false; BasePlayer.spawntime = Time.time; CC.CheckOnce(); }