public void Awake() { // Ensure directional light reference is not null if (_directionalLight == null) { Debug.LogError(string.Format("({0}) Directional Light reference not set, or null")); } else if (_directionalLight.type != LightType.Directional) { // Notify user if given directional light reference, is not a directional light Debug.LogWarning(string.Format("({0}) Directional Light reference set to light which is not a directional light")); } // Ensure player camera reference is not null if (_playerCamera == null) { Debug.LogError(string.Format("({0}) Player Camera reference not set, or null")); } else { // Get Bloom Optimized component on player camera _playerBloom = _playerCamera.GetComponent <BloomOptimized>(); if (_playerBloom == null) { // Unable to find component on player camera, // attach new Bloom Optimized component to player camera, and log it _playerBloom = _playerCamera.gameObject.AddComponent <BloomOptimized>(); Debug.LogWarning(string.Format("({0}) Unable to find Bloom Optimized Component on player camera, creating...", this.name)); } } }
/// <summary> /// Hide objects with IR tag, for this client /// </summary> public void IR(bool irVisible) { if (!isLocalPlayer) { return; } //if client can see IR objects, set these objects active for this client. //otherwise, turn em off GameObject cam = transform.Find("Camera").gameObject; ColorCorrectionCurves colorCorrection = cam.GetComponent <ColorCorrectionCurves>(); BloomOptimized bloom = cam.GetComponent <BloomOptimized>(); //if ir capable, ambient light is FULL, IR objects are VISIBLE, and bloom/desaturation are ACTIVE //otherwise, it's night time RenderSettings.ambientIntensity = irVisible ? 1.0f : 0.3f; RenderSettings.reflectionIntensity = irVisible ? 0.5f : 0.2f; foreach (GameObject obj in GameObject.FindGameObjectsWithTag("IR")) { obj.SetActive(irVisible); } bloom.enabled = irVisible; colorCorrection.enabled = irVisible; }
void Bloom() { BloomOptimized bloom = gameObject.GetComponent <BloomOptimized>(); switch (nodeType) { case 0: bloom.threshold = 0.8f; break; case 1: bloom.threshold = 0.3f; break; case 2: bloom.threshold = 1.0f; break; case 3: bloom.threshold = 0.3f; break; case 4: bloom.threshold = 1.0f; break; default: bloom.threshold = 0.8f; break; } }
private void EnableBloom(bool isOn) { if (CamerasMgr.MainCameraRoot == null) { return; } int lod = 250; if (Application.get_platform() == 11) { lod = 300; } else if (Application.get_platform() == 8) { lod = 300; } if (isOn && GameLevelManager.IsPostProcessReachQuality(lod) && SystemConfig.PP_BloomOn) { if (this.m_BloomOptimized == null) { this.m_BloomOptimized = CamerasMgr.MainCameraRoot.get_gameObject().AddComponent <BloomOptimized>(); } this.m_BloomOptimized.set_enabled(isOn); this.m_BloomOptimized.Initialization(); } else if (this.m_BloomOptimized != null) { this.m_BloomOptimized.set_enabled(false); } }
// Update is called once per frame IEnumerator slideToNewGame() { Camera camera = Camera.main; float time = 0; Rect currentCam = camera.rect; BloomOptimized bloomO = camera.GetComponent <BloomOptimized>(); float getCurrBloom = bloomO.intensity; RectTransform arcadeControls = GameObject.Find("AracdeControlsOverView").GetComponent <RectTransform>(); RectTransform outsideCanvas = GameObject.Find("Arcade Cabinent Canvas/Center").GetComponent <RectTransform>(); Vector3 outsideCanScale = outsideCanvas.localScale; float change = 0; //Zoom into the game camera and fade away the fisheye and bloom intensity while (time <= 1) { time += change; change += Time.deltaTime; camera.rect = new Rect(Mathf.Lerp(currentCam.x, 0, time), Mathf.Lerp(currentCam.y, 0, time), Mathf.Lerp(currentCam.width, 1, time), Mathf.Lerp(currentCam.height, 1, time)); bloomO.intensity = Mathf.Lerp(getCurrBloom, 0, time); outsideCanvas.localScale = Vector3.Lerp(outsideCanScale, new Vector3(1.65f, 1.65f, 1.65f), time); arcadeControls.localScale = Vector3.Lerp(Vector3.one, new Vector3(3f, 3f, 3f), time); yield return(new WaitForEndOfFrame()); } yield return(new WaitForSeconds(0.5f)); StartGame(); }
// Use this for initialization void Start () { noiseAndGrain = GetComponent<NoiseAndGrain>(); occlusion = GetComponent<ScreenSpaceAmbientOcclusion>(); bloom = GetComponent<BloomOptimized>(); qualityChanges(); }
void Start() { initFov = Camera.main.fieldOfView; minFov = initFov / zoom; v = GetComponent <VignetteAndChromaticAberration>() as VignetteAndChromaticAberration; b = GetComponent <BloomOptimized>(); player = FindObjectOfType <HealthManager>(); }
// Use this for initialization void Start() { noiseAndGrain = GetComponent <NoiseAndGrain>(); occlusion = GetComponent <ScreenSpaceAmbientOcclusion>(); bloom = GetComponent <BloomOptimized>(); qualityChanges(); }
void Awake() { m_Bloom = Camera.main.GetComponent <BloomOptimized>(); m_Depth = Camera.main.GetComponent <DepthOfField>(); m_SSAO = Camera.main.GetComponent <ScreenSpaceAmbientOcclusion>(); m_SunShafts = Camera.main.GetComponent <SunShafts>(); m_CCC = Camera.main.GetComponent <ColorCorrectionCurves>(); }
void Start() { bo = GetComponent<BloomOptimized>(); bo.enabled = false; vaca = GetComponent<VignetteAndChromaticAberration>(); vaca.enabled = false; so = GetComponent<ScreenOverlay>(); so.enabled = false; }
// Use this for initialization void Start () { cam = Camera.main; gob = cam.gameObject; bloom = gob.GetComponent<BloomOptimized>(); aa = gob.GetComponent<Antialiasing>(); InvokeRepeating("CheckEffects", 0, checkEffectsTime); }
void Start() { bo = GetComponent <BloomOptimized>(); bo.enabled = false; vaca = GetComponent <VignetteAndChromaticAberration>(); vaca.enabled = false; so = GetComponent <ScreenOverlay>(); so.enabled = false; }
void Awake() { this.story = GetComponent <Story>(); alarm_sfxVolume = alarm_sfx.volume; _bloom = Camera.main.GetComponent <BloomOptimized>(); _bloom.enabled = false; _bloomBaseValue = _bloom.intensity; uiStoryClick.onClick.AddListener(() => Clicked = true); }
// Use this for initialization void Start() { _SSAO = GetComponent <ScreenSpaceAmbientOcclusion> (); PlayerPrefs.SetInt("SSAO", 0); _CE = GetComponent <ContrastEnhance> (); PlayerPrefs.SetInt("CE", 0); _Bloom = GetComponent <BloomOptimized> (); PlayerPrefs.SetInt("Bloom", 0); _Vignette = GetComponent <VignetteAndChromaticAberration> (); PlayerPrefs.SetInt("Vignette", 0); }
void Start() { // Init vars. _bloom = GameObject.FindObjectOfType <BloomOptimized>(); if (_bloom != null) { _bloomInitValue = _bloom.intensity; } // Randomize initial rotation. transform.localRotation = UnityEngine.Random.rotation; }
void Start() { //UpdateTransform(); bloom = GetComponent <BloomOptimized>(); screenOverlay = GetComponent <ScreenOverlay>(); parent = transform.parent; defaultPositon = transform.localPosition; targetPosition = transform.position; defaultFOV = Camera.main.fieldOfView; stopFOV = defaultFOV + 35f; targetFOV = defaultFOV; player = FindObjectOfType <GameInput>(); animation = GetComponent <Animation>(); }
void Start() { camera = GetComponent<Camera>(); bloom = GetComponent<BloomOptimized>(); motionBlur = GetComponent<MotionBlur>(); grayscale = GetComponent<Grayscale>(); bloom.enabled = false; motionBlur.enabled = false; isInThePast = false; difference = normalRoom.transform.position - pastRoom.transform.position; pastMusicSource.volume = 0; player = GameObject.FindGameObjectWithTag("Player"); if (player == null) throw new UnassignedReferenceException("No player found."); }
void Start() { directionalLight = GameObject.Find("Directional light").GetComponent <Light>(); directionalLight.gameObject.SetActive(true); pointLight = GameObject.Find("Point light").GetComponent <Light>(); pointLight.gameObject.SetActive(true); bg = GameObject.Find("CubeBg"); bg.gameObject.SetActive(false); bloom = GetComponent <BloomOptimized> (); bloom.enabled = true; torch = GameObject.Find("HandTorch"); torch.SetActive(false); }
void Start() { if (Application.platform == RuntimePlatform.Android) { // jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); // jo = jc.GetStatic<AndroidJavaObject>("currentActivity"); isAndroid = true; } airPlaneAI = GameObject.Find("AirplaneAI"); // Init vars. _bloom = GameObject.FindObjectOfType <BloomOptimized>(); if (_bloom != null) { _bloomInitValue = _bloom.intensity; } //halo = sphere.GetComponent<Halo>(); // Randomize initial rotation. transform.localRotation = UnityEngine.Random.rotation; }
// Use this for initialization void Start() { hp = maxHp; cameraOffset = camera.transform.position - transform.position; enemyLocks = new List <GameObject>(); if (!indAxis) { cameraOffset += Vector3.up * 3f; } rb = GetComponent <Rigidbody>(); state = PlayerState.Flight; crosshairA = GameObject.Find("crosshair 1"); crosshairB = GameObject.Find("crosshair 2"); crosshairC = GameObject.Find("crosshair 3"); crosshairD = GameObject.Find("crosshair 4"); playerModel = GameObject.Find("choopa tank"); identityRotation = playerModel.transform.localRotation; audioSource = GetComponent <AudioSource>(); focalPoint = GameObject.Find("focal point"); shootTimer = shootLength; dof = camera.GetComponent <DepthOfField>(); bloom = camera.GetComponent <BloomOptimized>(); Time.timeScale = this.timeScale; hpText = GameObject.Find("HP Text").GetComponent <Text>(); _follow = GetComponentInParent <BGCurveFollow>(); targetSpeed = _follow.speed; lookAheadPos = _follow.GetAheadPos(lookAheadDistance + _follow.speed); transform.position = prevPos; //unlockMedal(50260); }
void Awake() { Time.timeScale = 1f; BloomOptimized blum = Camera.main.gameObject.GetComponent <BloomOptimized>(); blum.enabled = Game.lightEffects; Camera.main.backgroundColor = Game.frontColor; if (Game.coins > 0) { Game.coins = (Game.coins / 2); } swipe = transform.Find("Swipey").gameObject; iTween.MoveTo(swipe, iTween.Hash( "x", -23f, "y", 0f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutSine, "looptype", iTween.LoopType.none )); Game.SaveGame(); }
private void Start() { if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer) { SunShafts sunshafts = Camera.main.GetComponent <SunShafts>(); sunshafts.enabled = false; BloomOptimized bloom = Camera.main.GetComponent <BloomOptimized>(); bloom.enabled = false; } if (PlayerPrefs.GetInt("WatchedIntro", 0) == 1) { LoadSceneGame(); } else { Cursor.SetCursor(Utils.TextureFromSprite(DefaultCursorSprite), Vector2.zero, CursorMode.ForceSoftware); StartCoroutine(IntroCR()); } }
void Awake() { if (!PlayerPrefs.HasKey("LensFlare")) { PlayerPrefs.SetInt("LensFlare", (HR_HighwayRacerProperties.Instance._defaultFlares == true ? 1 : 0)); } if (!PlayerPrefs.HasKey("Bloom")) { PlayerPrefs.SetInt("Bloom", (HR_HighwayRacerProperties.Instance._defaultBloom == true ? 1 : 0)); } if (!PlayerPrefs.HasKey("HQLights")) { PlayerPrefs.SetInt("HQLights", (HR_HighwayRacerProperties.Instance._defaultHQLights == true ? 1 : 0)); } bloom = GetComponent <BloomOptimized>(); flareLayer = GameObject.FindObjectOfType <FlareLayer>(); Check(); }
void Awake() { if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer) { SunShafts sunshafts = Camera.main.GetComponent <SunShafts>(); sunshafts.enabled = false; BloomOptimized bloom = Camera.main.GetComponent <BloomOptimized>(); bloom.enabled = false; } AwakeLevelManagement(); AwakeHelpManagement(); Spells.Add(SpellType.Kraken, new Spell(SpellType.Kraken, 10, true)); Spells.Add(SpellType.Alruana, new Spell(SpellType.Alruana, 8, true)); Spells.Add(SpellType.Dracula, new Spell(SpellType.Dracula, 3, false)); Spells.Add(SpellType.Tornado, new Spell(SpellType.Tornado, 10000, false)); DefaultCursorTex = Utils.TextureFromSprite(DefaultCursorSprite); SetDefaultCursor(); AwakeAudio(); }
/*--------------------------------------------------------------------------------------------*/ protected override void PerformAdjustments() { Camera mainSceneCam = UnityUtil.FindComponentAll <Camera>(MainSceneCameraName); mainSceneCam.gameObject.SetActive(false); Camera cam = UnityUtil.FindComponentAll <Camera>(CameraName); cam.clearFlags = CameraClearFlags.Color; cam.backgroundColor = Color.black; if (UseBloom && cam.GetComponent <BloomOptimized>() == null) { BloomOptimized bloom = cam.gameObject.AddComponent <BloomOptimized>(); bloom.threshold = 0.35f; bloom.intensity = 0.6f; bloom.blurSize = 1; bloom.blurIterations = 2; bloom.blurType = BloomOptimized.BlurType.Standard; bloom.fastBloomShader = Shader.Find("Hidden/FastBloom"); } }
public void Toggle_Effects() { effectsIsOn = !effectsIsOn; // Depth of Field DepthOfFieldDeprecated dof = GameObject.FindObjectOfType <DepthOfFieldDeprecated> (); if (dof) { dof.enabled = effectsIsOn; } // Bloom BloomOptimized bloom = GameObject.FindObjectOfType <BloomOptimized> (); if (bloom) { bloom.enabled = effectsIsOn; } // Sun Shaft SunShafts[] sunShaftS = GameObject.FindObjectsOfType <SunShafts> (); for (int a = 0; a < sunShaftS.Length; a++) { sunShaftS [a].enabled = effectsIsOn; } // Color Grading MobileColorGrading colorGrading = GameObject.FindObjectOfType <MobileColorGrading> (); if (colorGrading) { colorGrading.enabled = effectsIsOn; } }
public override void Start() { bloom = gameObject.GetComponent <BloomOptimized>(); dof = gameObject.GetComponent <DepthOfField>(); ssao = gameObject.GetComponent <ScreenSpaceAmbientOcclusion>(); }
public void Update_Bloom(Camera mainCamera, bool enabled, float intensity, float threshold) { if (enabled) { if (!mainCamera.GetComponent <BloomOptimized> ()) { mainCamera.gameObject.AddComponent <BloomOptimized> (); BloomOptimized bloom = mainCamera.GetComponent <BloomOptimized> (); #if UNITY_EDITOR if (mainCamera.GetComponent <AudioListener> ()) { UnityEditorInternal.ComponentUtility.MoveComponentDown(mainCamera.GetComponent <AudioListener> ()); } if (mainCamera.GetComponent <MobileColorGrading> ()) { UnityEditorInternal.ComponentUtility.MoveComponentDown(mainCamera.GetComponent <MobileColorGrading> ()); UnityEditorInternal.ComponentUtility.MoveComponentDown(mainCamera.GetComponent <MobileColorGrading> ()); } if (mainCamera.GetComponent <BloomOptimized> ()) { UnityEditorInternal.ComponentUtility.MoveComponentDown(mainCamera.GetComponent <BloomOptimized> ()); UnityEditorInternal.ComponentUtility.MoveComponentDown(mainCamera.GetComponent <BloomOptimized> ()); } if (mainCamera.GetComponent <DepthOfFieldDeprecated> ()) { UnityEditorInternal.ComponentUtility.MoveComponentDown(mainCamera.GetComponent <DepthOfFieldDeprecated> ()); UnityEditorInternal.ComponentUtility.MoveComponentDown(mainCamera.GetComponent <DepthOfFieldDeprecated> ()); } #endif bloom.fastBloomShader = Shader.Find("Hidden/FastBloom"); bloom.intensity = intensity; bloom.threshold = threshold; bloom.blurSize = 5.5f; bloom.blurIterations = 4; bloom.blurType = BloomOptimized.BlurType.Standard; #if UNITY_EDITOR UnityEditorInternal.ComponentUtility.MoveComponentUp(bloom); #endif } else { BloomOptimized bloom = mainCamera.GetComponent <BloomOptimized> (); bloom.intensity = intensity; bloom.threshold = threshold; bloom.blurSize = 5.5f; bloom.blurIterations = 4; bloom.blurType = BloomOptimized.BlurType.Standard; } } else { if (mainCamera.GetComponent <BloomOptimized> ()) { if (Application.isPlaying) { Destroy(mainCamera.GetComponent <BloomOptimized> ()); } else { DestroyImmediate(mainCamera.GetComponent <BloomOptimized> ()); } } } }
void Awake() { bloomOptimized = gameObject.GetComponent <BloomOptimized>(); }
// Use this for initialization void Start() { bright = GetComponent <BrightnessEffect>(); bloom = GetComponent <BloomOptimized>(); }
void Start( ) { //Assign camera effect vars CameraVignette = GetComponent<VignetteAndChromaticAberration>( ); CameraBloom = GetComponent<BloomOptimized>( ); CameraDoF = GetComponent<DepthOfField>( ); CameraPos = new Vector3( ); //Debug SetCameraMode( CameraMode.GAME ); }
void Start() { Bloom = GetComponent <BloomOptimized> (); }