async Task <Uri> Noise(int EffectPercentage) { var level = NoiseLevel.Minimum; if (EffectPercentage <= 35) { level = NoiseLevel.Minimum; } else if (EffectPercentage > 70) { level = NoiseLevel.Maximum; } else { level = NoiseLevel.Medium; } using (var source = new StorageFileImageSource(imageStorageFile)) using (var contrastEffect = new ContrastEffect(source) { Level = 0.6 }) using (var sharpnessEffect = new NoiseEffect(contrastEffect) { Level = level }) { LastEffect = sharpnessEffect; return(await SaveToImage()); } }
void Start() { bloomScript = GetComponent <BloomAndLensFlares>(); vignetteScript = GetComponent <Vignetting>(); noiseScript = GetComponent <NoiseEffect>(); if (bloomScript) { hasBloom = true; } else { hasBloom = false; } if (vignetteScript) { hasVignetting = true; } else { hasVignetting = false; } if (noiseScript) { hasNoise = true; } else { hasNoise = false; } }
// Use this for initialization void Awake() { _Instance = this; IsMovePlayer = false; /*if (GlobalData.GetInstance().gameMode == GameMode.SoloMode) { * IsMovePlayer = false; * } * else { * IsMovePlayer = true; * }*/ NoiseScript = GetComponent <NoiseEffect>(); ScreenOverScript = GetComponent <ScreenOverlay>(); ScreenOverScript.enabled = false; GmObj = gameObject; GmTran = transform; InitCamPathInfo(); if (CamPathTest != null) { Invoke("TestDelayMoveCamera", 1f); } InputEventCtrl.GetInstance().ClickStartBtOneEvent += clickStartBtOneEvent; }
// Use this for initialization void Start() { motionBlur = this.GetComponent<MotionBlur>(); noiseEffect = this.GetComponent<NoiseEffect>(); PlayerMovement.Instance.RewindBegin += () => { applyEffects(); }; PlayerMovement.Instance.RewindEnd += () => { removeEffects(); }; }
void Awake() { Services.DrugCameraEffects = this; sun = this.GetComponent<SunShafts>(); noiseEffect = this.GetComponent<NoiseEffect>(); vortexEffect = this.GetComponent<VortexEffect>(); blur = this.GetComponent<Blur>(); trailRenderer = GameObject.Find("John").GetComponent<TrailRenderer>(); Services.GameState.PlayerState.WeedChangedEvent += HandleWeedChangedEvent; }
// Use this for initialization /// <summary> /// Called when a CameraManagerTetris element is instantiate (when the scene is loading). /// We use it for initialisation. Ensures camera positions (different for mobile or pc) /// Shortcuts to access camera effect are created. /// </summary> /// <returns>void</returns> void Start() { if (Application.isMobilePlatform) { main.transform.position = new Vector3(0, 10f, -10); } else { main.transform.position = new Vector3(4.5f, 10f, -10); } blur = main.GetComponent <Blur>() as Blur; noise = main.GetComponent <NoiseEffect>() as NoiseEffect; setParamId(0); }
void Start() { mainCamera = Camera.main; cameraNoise = Camera.main.gameObject.GetComponent <NoiseEffect>(); timeTakenDuringLerp = captureTime / 2; _count = 0; _clockTransforms = new Queue <Capture>(); boyController = GetComponent <BoyController>(); rigidBody = GetComponent <Rigidbody2D>(); _movedBack = true; _stillLerping = false; bntClicked = false; btnClock.onClick.AddListener(btnClicked); }
public override void Init(RendererBase <ToyWorld> renderer, ToyWorld world, PostprocessingSettings settings) { Settings = settings; if (Settings.EnabledPostprocessing.HasFlag(RenderRequestPostprocessing.Noise)) { if (m_noiseEffect == null) { m_noiseEffect = renderer.EffectManager.Get <NoiseEffect>(); } renderer.EffectManager.Use(m_noiseEffect); // Need to use the effect to set uniforms m_noiseEffect.ViewportSizeUniform((Vector2I)Owner.Resolution); m_noiseEffect.SceneTextureUniform((int)RenderRequestBase.TextureBindPosition.PostEffectTextureBindPosition); } }
void Start() { noiseEffect = Camera.main.GetComponent<NoiseEffect>(); if( noiseEffect ) { noiseEffect.grainIntensityMin = fromGrainIntensityMin; noiseEffect.grainIntensityMax = fromGrainIntensityMax; noiseEffect.scratchIntensityMin = fromScratchIntensityMin; noiseEffect.scratchIntensityMax = fromScratchIntensityMax; noiseEffect.enabled = true; StartCoroutine( "DoNoiseFade" ); } }
public AIStateWandering(ArtificialIntelligence brains, float searchDistance, Transform pathRoot, Image suspentionBar) : base(brains) { _searchDistance = searchDistance; State = EAIState.Wandering; _movementController = new SequentialMovement(pathRoot.GetComponentsInChildren <Transform>(), _masterBrain.MovableObject, true); _bellCreepy = Resources.Load <AudioClip>("Sounds/bellCreepy"); _whispering = Resources.Load <AudioClip>("Sounds/whisper"); _effect = GameObject.FindObjectOfType <NoiseEffect>(); _player = GameObject.FindObjectOfType <PlayerBehaviour>(); _suspentionBar = suspentionBar; _guardBrains = (GuardBrains)brains; }
// ---------------------------------------- // FADING METHOD // ---------------------------------------- public void OnGUI() { _RectToFade = MathHelper.ViewportRectToScreenRect(this.camera.rect); if (this.camera.rect.height < 1) { _RectToFade.y = 0; } // Fade alpha if active if ((fadeDirection == -1 && currentAlpha > targetAlpha) || (fadeDirection == 1 && currentAlpha < targetAlpha)) { // Advance fade by fraction of full fade time currentAlpha += (fadeDirection * alphaDifference) * (Time.deltaTime / currentDuration); // Clamp to 0-1 currentAlpha = Mathf.Clamp01(currentAlpha); } NoiseEffect noise = GetComponent <NoiseEffect>(); // Draw only if not transculent if (currentAlpha > 0) { // Draw texture at depth alphaColor.a = currentAlpha; GUI.color = alphaColor; GUI.depth = guiDepth; GUI.Label(_RectToFade, dummyTex, backgroundStyle); if (UseNoiseEffect) { noise.grainIntensityMin = currentAlpha * 4; noise.grainIntensityMax = currentAlpha * 5; //Debug.Log(1 - currentAlpha); } } else { noise.grainIntensityMin = 0; noise.grainIntensityMax = 0; } }
void Start() { base.isLocalPlayer = true; GeneralVariables.cachedSpectCam = cachedSpectCam; uic = GeneralVariables.uiController; rattleTSS = equipmentRattleSource.GetComponent <TimeScaleSound>(); healthBar = uic.healthBar; healthText = uic.healthText; shieldBar = uic.shieldBar; shieldText = uic.shieldText; staminaBar = uic.staminaBar; shieldTexture = uic.shieldTexture; ne = uic.guiCamera.GetComponent <NoiseEffect>(); disE = uic.guiCamera.GetComponent <DistortionEffect>(); staminaBackground = staminaBar.backgroundWidget; defStaminaBGCol = staminaBackground.color; bloodyScreen = uic.bloodyScreen; flickeringGUI = uic.flickeringPanels; sa = uic.screenAdjustment; bloodyScreen.material.color = DarkRef.SetAlpha(bloodyScreen.material.color, 0f); PlayerReference pr = GeneralVariables.playerRef; pm = GetComponent <PlayerMovement>(); playerLook = GetComponent <PlayerLook>(); vignetting = cam.GetComponent <VignettingC>(); damageBreathBoost = 0f; ne.grainIntensity = 0f; disE.baseIntensity = 0f; guiSizeModH = guiSizeModS = 1f; healthBar.value = 0f; shieldBar.value = 0f; breathFactor = 1f; hearingPenalty = 1f; standardFreq = 5000f; wm = pr.wm; wc = pr.wc; shieldAlpha = 0f; finalShAlpha = 0f; flickerIntensity = 0.5f; percent = 1f; shPercent = 1f; recovering = true; canSprint = true; initTime = Time.time; damageIDs = new List <byte>(); damageInflicted = new List <int>(); killerID = -1; headID = -1; lastWeaponID = -1; builtData = ""; //Initialize values. curHealth = maxHealth; curShield = maxShield; AntiHackSystem.ProtectInt("maxHealth", maxHealth); AntiHackSystem.ProtectInt("maxShield", maxShield); oldHealth = curHealth; oldShield = curShield; }
public void Add(NoiseEffect ne) { transforms.capacity = transforms.length + 1; transforms.Add(ne.transform); numJobs++; }
// Use this for initialization void Start() { heartRateMonitor = 1f; transformedForward = new Vector3(); finalThrust = new Vector3(); powerVomitCharged = false; initialRotation = transform.rotation; bloom = Camera.mainCamera.GetComponent("Bloom") as Bloom; noise = Camera.mainCamera.GetComponent("NoiseEffect") as NoiseEffect; colour = Camera.mainCamera.GetComponent("ColorCorrectionCurves") as ColorCorrectionCurves; particleStartSize = particleStartSize; Reset(); }