// Use this for initialization void Start() { audioSource = gameObject.GetComponent <AudioSource>(); gameManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameStateManager>(); mainCamera = GameObject.FindGameObjectWithTag("MainCamera"); UICanvas = GameObject.FindGameObjectWithTag("UICanvas"); completionTracker = GameObject.FindGameObjectWithTag("CompletionKeeper").GetComponent <CompletionKeeper>(); }
// Use this for initialization void Start() { //clear the player list and add the original player in the level to it playerList.Clear(); playerList.Add(GameObject.FindGameObjectWithTag("Player")); //assign canvas canvas = GameObject.FindGameObjectWithTag("UICanvas"); //spawn death circle ui sprite, parent it correctly and position it above turret tempDeathTimerSprite = Instantiate(deathTimerSprite, transform.position, Quaternion.identity); tempDeathTimerSprite.transform.SetParent(canvas.transform); tempDeathTimerSprite.GetComponent <RectTransform>().SetAsFirstSibling(); Vector2 SliderPos = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>().WorldToScreenPoint((this.transform.position)); tempDeathTimerSprite.transform.position = SliderPos; //assign sound source smokeSound = gameObject.GetComponent <AudioSource>(); completionKeeper = GameObject.FindGameObjectWithTag("CompletionKeeper").GetComponent <CompletionKeeper>(); }
// Use this for initialization void Start() //assign variables and post processing settings { staticNoise = gameObject.GetComponent <AudioSource>(); completionKeeper = GameObject.FindGameObjectWithTag("CompletionKeeper").GetComponent <CompletionKeeper>(); mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); PPSetting = PlayerPrefs.GetString("PPSetting", "max"); if (PPSetting == "max") { mainCamera.GetComponent <PostProcessingBehaviour>().profile = completionKeeper.cctvPPProfileMax; } else if (PPSetting == "min") { mainCamera.GetComponent <PostProcessingBehaviour>().profile = completionKeeper.cctvPPProfileMin; } else if (PPSetting == "none") { mainCamera.GetComponent <PostProcessingBehaviour>().profile = completionKeeper.cctvPPProfileNone; } }
// Use this for initialization void Start() { completionKeeper = GameObject.FindGameObjectWithTag("CompletionKeeper").GetComponent <CompletionKeeper>(); if (completionKeeper != null) { if (completionKeeper.toggleLasers == false) { foreach (GameObject turret in turretList) { turret.GetComponent <TurretShooter>().isTargettingLaserOn = false; } } else { foreach (GameObject turret in turretList) { turret.GetComponent <TurretShooter>().isTargettingLaserOn = true; } } } }
// Use this for initialization void Start() { //assign dynamic variables and setting post processing settings buttonNoise = gameObject.GetComponent <AudioSource>(); completionKeeper = GameObject.FindGameObjectWithTag("CompletionKeeper").GetComponent <CompletionKeeper>(); PPSetting = PlayerPrefs.GetString("PPSetting", "max"); if (PPSetting == "max") { completionKeeper.currentPostProcessingSettings = CompletionKeeper.PostProcessingSettings.max; mainCamera.GetComponent <PostProcessingBehaviour>().profile = completionKeeper.mainMenuPPProfileMax; } else if (PPSetting == "min") { completionKeeper.currentPostProcessingSettings = CompletionKeeper.PostProcessingSettings.min; mainCamera.GetComponent <PostProcessingBehaviour>().profile = completionKeeper.mainMenuPPProfileMin; } else if (PPSetting == "none") { completionKeeper.currentPostProcessingSettings = CompletionKeeper.PostProcessingSettings.none; mainCamera.GetComponent <PostProcessingBehaviour>().profile = completionKeeper.mainMenuPPProfileNone; } }
// Use this for initialization void Start() { completionKeeper = GameObject.FindGameObjectWithTag("CompletionKeeper").GetComponent <CompletionKeeper>(); completionKeeper.gameObject.GetComponent <AudioSource>().volume = 0; }
// Use this for initialization void Start() { completionKeeper = GameObject.FindGameObjectWithTag("CompletionKeeper").GetComponent <CompletionKeeper>(); }