Ejemplo n.º 1
0
        private void UpdateWetLensIntensity(float intensity)
        {
#if UNITY_POST_PROCESSING_STACK_V2
            if (PCommon.CurrentRenderPipeline == PRenderPipelineType.Builtin)
            {
                if (PostProcessProfile == null)
                {
                    return;
                }
                PWetLens wetlensSettings;
                if (PostProcessProfile.TryGetSettings <PWetLens>(out wetlensSettings))
                {
                    wetlensSettings.intensity.Override(intensity);
                }
            }
#endif

#if POSEIDON_URP
            if (PCommon.CurrentRenderPipeline == PRenderPipelineType.Universal)
            {
                if (VolumeProfile == null)
                {
                    return;
                }
                PWetLensOverride wetlensSettings;
                if (VolumeProfile.TryGet <PWetLensOverride>(out wetlensSettings))
                {
                    wetlensSettings.intensity.Override(intensity);
                }
            }
#endif
        }
Ejemplo n.º 2
0
        private static void SyncHDRPContactShadows(VolumeProfile sceneProfile, VolumeProfile sourceProfile)
        {
            if (sceneProfile == null || sourceProfile == null)
            {
                return;
            }

            if (sceneProfile.TryGet(out ContactShadows contactShadowsScene))
            {
                if (sourceProfile.TryGet(out ContactShadows contactShadowsSource))
                {
                    contactShadowsSource.enable.value = contactShadowsScene.enable.value;
                    contactShadowsSource.length.value = contactShadowsScene.length.value;
                    contactShadowsSource.distanceScaleFactor.value = contactShadowsScene.distanceScaleFactor.value;
                    contactShadowsSource.maxDistance.value         = contactShadowsScene.maxDistance.value;
#if UNITY_2020_1_OR_NEWER
                    contactShadowsSource.minDistance.value    = contactShadowsScene.minDistance.value;
                    contactShadowsSource.fadeInDistance.value = contactShadowsScene.fadeInDistance.value;
#endif
                    contactShadowsSource.fadeDistance.value = contactShadowsScene.fadeDistance.value;
                    contactShadowsSource.opacity.value      = contactShadowsScene.opacity.value;
                    contactShadowsSource.quality.value      = contactShadowsScene.quality.value;
                    contactShadowsSource.sampleCount        = contactShadowsScene.sampleCount;
                }
            }
        }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        oM = OptionsManager.instance;
        gm = GameManager.instance;
        Input.simulateMouseWithTouches = true;
        playerRigidbody2D = GetComponent <Rigidbody2D>();

        comboText.text = "0";

        combo                        = 0;
        maxTeleportJuice             = startMaxTeleportJuice;
        maxHitPoints                 = startMaxHitPoints;
        hitPoints                    = maxHitPoints;
        teleportJuice                = maxTeleportJuice;
        baseTpjuiceCost              = startBaseTpjuiceCost;
        tpDamageOutput               = initialTpDamageOutput;
        contactDamageOutput          = inititalContactDamageOutput;
        currency                     = startCurrency;
        teleportJuiceRegenMultiplier = startTeleportJuiceRegenMultiplier;
        teleportJuiceDrainMultiplier = startTeleportJuiceDrainMultiplier;
        teleportRange                = startTeleportRange;

        healthSlider.maxValue   = maxHitPoints;
        teleportSlider.maxValue = maxTeleportJuice;

        brightnessFilter.enabled = false;

        spR = teleportTargetGraphic.GetComponentsInChildren <SpriteRenderer>();

        v = GameObject.FindGameObjectWithTag("TpProfile").GetComponent <Volume>()?.profile;
        v.TryGet(out ld);
        v.TryGet(out vg);
        v.TryGet(out cha);
    }
        private void Start()
        {
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible   = true;
            cutPlane.gameObject.SetActive(false);

            anim      = GetComponent <Animator>();
            movement  = GetComponent <MovementInput>();
            normalFOV = TPCamera.m_Lens.FieldOfView;
            composers = new CinemachineComposer[3];
            for (int i = 0; i < 3; i++)
            {
                composers[i] = TPCamera.GetRig(i).GetCinemachineComponent <CinemachineComposer>();
            }

            normalOffset = composers[0].m_TrackedObjectOffset;

            particles = cutPlane.GetComponentsInChildren <ParticleSystem>();

            cameraTs        = Camera.main.transform;
            secondReference = cameraTs.transform.Find("SecondReference").transform;

            profile = cameraTs.GetComponentInChildren <Volume>().profile;

            planeReference = cutPlane.GetChild(0);
        }
Ejemplo n.º 5
0
        protected override void ConvertToTarget(BIRPRendering.PostProcessEffectSettings oldSettings,
                                                VolumeProfile targetProfile)
        {
            var oldGrain = oldSettings as BIRPRendering.Grain;

            var newVolumeComponent = AddVolumeComponentToAsset <URPRendering.FilmGrain>(targetProfile);

            newVolumeComponent.active = oldGrain.active;

            oldGrain.intensity.Convert(newVolumeComponent.intensity, enabledState: oldGrain.enabled);
            oldGrain.lumContrib.Convert(newVolumeComponent.response);

            newVolumeComponent.type.overrideState = oldGrain.size.overrideState;
            if (oldGrain.size.value > 1.5f)
            {
                newVolumeComponent.type.value = URPRendering.FilmGrainLookup.Medium3;
            }
            else if (oldGrain.size.value > 1.25f)
            {
                newVolumeComponent.type.value = URPRendering.FilmGrainLookup.Medium2;
            }
            else if (oldGrain.size.value > 0.7f)
            {
                newVolumeComponent.type.value = URPRendering.FilmGrainLookup.Thin2;
            }
            else
            {
                newVolumeComponent.type.value = URPRendering.FilmGrainLookup.Thin1;
            }

            // TODO: No clear conversions for these?
            // oldGrain.colored
        }
Ejemplo n.º 6
0
 void Start()
 {
     LoadGameData();
     StartLoadMainMenu();
     profile           = vol.sharedProfile;
     Screen.fullScreen = _gd.isFullscreen;
 }
    private void Start()
    {
        cam = Camera.main;

        volume = FindObjectOfType <Volume>().GetComponent <Volume>().profile;
        volume.TryGet(out colorAdj);
    }
Ejemplo n.º 8
0
        void FixDefaultVolumeProfileAssigned(bool fromAsyncUnused)
        {
            if (!IsHdrpAssetUsedCorrect())
            {
                FixHdrpAssetUsed(fromAsync: false);
            }

            var hdrpAsset = HDRenderPipeline.currentAsset;

            if (hdrpAsset == null)
            {
                return;
            }

            VolumeProfile defaultSettingsVolumeProfileInPackage = hdrpAsset.renderPipelineEditorResources.defaultSettingsVolumeProfile;
            string        defaultSettingsVolumeProfilePath      = "Assets/" + HDProjectSettings.projectSettingsFolderPath + '/' + defaultSettingsVolumeProfileInPackage.name + ".asset";

            //try load one if one already exist
            VolumeProfile defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath <VolumeProfile>(defaultSettingsVolumeProfilePath);

            if (defaultSettingsVolumeProfile == null || defaultSettingsVolumeProfile.Equals(null))
            {
                //else create it
                AssetDatabase.CopyAsset(AssetDatabase.GetAssetPath(defaultSettingsVolumeProfileInPackage), defaultSettingsVolumeProfilePath);
                defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath <VolumeProfile>(defaultSettingsVolumeProfilePath);
            }
            hdrpAsset.defaultVolumeProfile = defaultSettingsVolumeProfile;

            EditorUtility.SetDirty(hdrpAsset);
        }
Ejemplo n.º 9
0
        private static void SyncHDRPFog(VolumeProfile sceneProfile, VolumeProfile sourceProfile)
        {
            if (sceneProfile == null || sourceProfile == null)
            {
                return;
            }

            if (sceneProfile.TryGet(out UnityEngine.Rendering.HighDefinition.Fog fogScene))
            {
                if (sourceProfile.TryGet(out UnityEngine.Rendering.HighDefinition.Fog fogSource))
                {
                    fogSource.enabled.value                     = fogScene.enabled.value;
                    fogSource.maxFogDistance.value              = fogScene.maxFogDistance.value;
                    fogSource.baseHeight.value                  = fogScene.baseHeight.value;
                    fogSource.maximumHeight.value               = fogScene.maximumHeight.value;
                    fogSource.maxFogDistance.value              = fogScene.maxFogDistance.value;
                    fogSource.colorMode.value                   = fogScene.colorMode.value;
                    fogSource.tint.value                        = fogScene.tint.value;
                    fogSource.mipFogNear.value                  = fogScene.mipFogNear.value;
                    fogSource.mipFogFar.value                   = fogScene.mipFogFar.value;
                    fogSource.mipFogMaxMip.value                = fogScene.mipFogMaxMip.value;
                    fogSource.enableVolumetricFog.value         = fogScene.enableVolumetricFog.value;
                    fogSource.albedo.value                      = fogScene.albedo.value;
                    fogSource.anisotropy.value                  = fogScene.anisotropy.value;
                    fogSource.globalLightProbeDimmer.value      = fogScene.globalLightProbeDimmer.value;
                    fogSource.depthExtent.value                 = fogScene.depthExtent.value;
                    fogSource.sliceDistributionUniformity.value = fogScene.sliceDistributionUniformity.value;
                    fogSource.filter.value                      = fogScene.filter.value;
                }
            }
        }
Ejemplo n.º 10
0
        void UpdateSkyIntPopupData(bool reset = false)
        {
            if (m_SkyClassNames == null)
            {
                m_SkyClassNames = new List <GUIContent>();
                m_SkyUniqueIDs  = new List <int>();
            }

            // We always reinit because the content can change depending on the volume and we are not always notified when this happens (like for undo/redo for example)
            m_SkyClassNames.Clear();
            m_SkyUniqueIDs.Clear();

            // Add special "None" case.
            m_SkyClassNames.Add(new GUIContent("None"));
            m_SkyUniqueIDs.Add(0);

            VolumeProfile profile = m_VolumeProfile.objectReferenceValue as VolumeProfile;

            if (profile != null)
            {
                var skyTypesDict = SkyManager.skyTypesDict;

                foreach (KeyValuePair <int, Type> kvp in skyTypesDict)
                {
                    if (profile.Has(kvp.Value))
                    {
                        m_SkyClassNames.Add(new GUIContent(kvp.Value.Name.ToString()));
                        m_SkyUniqueIDs.Add(kvp.Key);
                    }
                }
            }
        }
Ejemplo n.º 11
0
        private void UpdateUnderwaterIntensity(float intensity)
        {
#if UNITY_POST_PROCESSING_STACK_V2
            if (PCommon.CurrentRenderPipeline == PRenderPipelineType.Builtin)
            {
                if (PostProcessProfile == null)
                {
                    return;
                }
                PUnderwater underwaterSettings;
                if (PostProcessProfile.TryGetSettings <PUnderwater>(out underwaterSettings))
                {
                    underwaterSettings.intensity.Override(intensity);
                }
            }
#endif

#if POSEIDON_URP
            if (PCommon.CurrentRenderPipeline == PRenderPipelineType.Universal)
            {
                if (VolumeProfile == null)
                {
                    return;
                }
                PUnderwaterOverride underwaterSettigns;
                if (VolumeProfile.TryGet <PUnderwaterOverride>(out underwaterSettigns))
                {
                    underwaterSettigns.intensity.Override(intensity);
                }
            }
#endif
        }
Ejemplo n.º 12
0
 void ChangePostProcessVolume(VolumeProfile outPP)
 {
     //Weight do nothing
     volume.weight  = Mathf.Lerp(1.0f, 0.0f, 5f);
     volume.profile = outPP;
     volume.weight  = Mathf.Lerp(0.0f, 1.0f, 5f);
 }
Ejemplo n.º 13
0
        protected override void ConvertToTarget(BIRPRendering.PostProcessEffectSettings oldSettings,
                                                VolumeProfile targetProfile)
        {
            var oldVignette = oldSettings as BIRPRendering.Vignette;

            var newVolumeComponent = AddVolumeComponentToAsset <URPRendering.Vignette>(targetProfile);

            newVolumeComponent.active = oldVignette.active;

            oldVignette.color.Convert(newVolumeComponent.color);

            if (oldVignette.mode.value == BIRPRendering.VignetteMode.Masked)
            {
                // There's not much we can do with the Masked mode at present,
                // so we just assume the old opacity should be used as intensity,
                // and leave all other settings at default values.
                oldVignette.opacity.Convert(newVolumeComponent.intensity, enabledState: oldSettings.enabled);
            }
            else
            {
                oldVignette.intensity.Convert(newVolumeComponent.intensity, enabledState: oldSettings.enabled);

                oldVignette.center.Convert(newVolumeComponent.center);
                oldVignette.rounded.Convert(newVolumeComponent.rounded);
                oldVignette.smoothness.Convert(newVolumeComponent.smoothness);
            }

            // TODO: No clear conversions for these?
            // oldVignette.mask
            // oldVignette.roundness
        }
Ejemplo n.º 14
0
    // Start is called before the first frame update
    void Start()
    {
        v = GameObject.FindObjectOfType <Volume>().profile;
        v.TryGet(out b);

        //Shuffle
        for (int i = 0; i < colors.Length; i++)
        {
            int   rnd       = Random.Range(0, colors.Length);
            Color tempColor = colors[rnd];
            colors[rnd] = colors[i];
            colors[i]   = tempColor;
        }

        for (int i = 0; i < spriteMats.Length; i++)
        {
            spriteMats[i].SetColor("_Color", colors[i]);
        }

        for (int i = 0; i < TMProMats.Length; i++)
        {
            //TMProMats[i].SetColor("_FaceColor", ColToTmpCol(colors[spriteMats.Length]));
            TMProMats[i].SetColor("_FaceColor", colors[spriteMats.Length]);
        }
    }
Ejemplo n.º 15
0
    // Start is called before the first frame update
    void Start()
    {
        volume = GetComponent <Volume>();
        VolumeProfile profile = volume.sharedProfile;

        profile.TryGet(out vignette);
    }
        void RefreshEffectListEditor(VolumeProfile asset)
        {
            m_ComponentList.Clear();

            if (asset != null)
                m_ComponentList.Init(asset, new SerializedObject(asset));
        }
Ejemplo n.º 17
0
        private void AppendTick(Security security, ExecutionMessage tick)
        {
            var time  = tick.ServerTime;
            var price = tick.TradePrice.Value;

            if (_candle == null || time >= _candle.CloseTime)
            {
                if (_candle != null)
                {
                    _candle.State = CandleStates.Finished;

                    lock (_updatedCandles.SyncRoot)
                        _updatedCandles[_candle.OpenTime] = _candle;

                    _lastPrice = _candle.ClosePrice;
                }

                //var t = TimeframeSegmentDataSeries.GetTimeframePeriod(time.DateTime, _timeframe);
                var tf     = TimeSpan.FromMinutes(_timeframe);
                var bounds = tf.GetCandleBounds(time, _security.Board);

                _candle = new TimeFrameCandle
                {
                    TimeFrame = tf,
                    OpenTime  = bounds.Min,
                    CloseTime = bounds.Max,
                    Security  = security,
                };

                _volumeProfile      = new VolumeProfile();
                _candle.PriceLevels = _volumeProfile.PriceLevels;

                _candle.OpenPrice = _candle.HighPrice = _candle.LowPrice = _candle.ClosePrice = price;
            }

            if (time < _candle.OpenTime)
            {
                throw new InvalidOperationException("invalid time");
            }

            if (price > _candle.HighPrice)
            {
                _candle.HighPrice = price;
            }

            if (price < _candle.LowPrice)
            {
                _candle.LowPrice = price;
            }

            _candle.ClosePrice = price;

            _candle.TotalVolume += tick.TradeVolume.Value;

            _volumeProfile.Update(new TickCandleBuilderSourceValue(security, tick));

            lock (_updatedCandles.SyncRoot)
                _updatedCandles[_candle.OpenTime] = _candle;
        }
Ejemplo n.º 18
0
        bool UpdateVolumeProfile(Volume volume, out VisualEnvironment visualEnvironment, out HDRISky sky, ref int volumeProfileHash)
        {
            var lookDevVolumeProfile = m_GlobalSettings.GetOrAssignLookDevVolumeProfile();
            int newHashCode          = lookDevVolumeProfile.GetHashCode();

            if (newHashCode != volumeProfileHash)
            {
                VolumeProfile oldProfile = volume.sharedProfile;

                volumeProfileHash = newHashCode;

                VolumeProfile profile = ScriptableObject.Instantiate(lookDevVolumeProfile);
                profile.hideFlags    = HideFlags.HideAndDontSave;
                volume.sharedProfile = profile;

                // Remove potentially existing components in the user profile.
                if (profile.TryGet(out visualEnvironment))
                {
                    profile.Remove <VisualEnvironment>();
                }

                if (profile.TryGet(out sky))
                {
                    profile.Remove <HDRISky>();
                }

                // If there was a profile before we needed to re-instantiate the new profile, we need to copy the data over for sky settings.
                if (oldProfile != null)
                {
                    if (oldProfile.TryGet(out HDRISky oldSky))
                    {
                        sky = Object.Instantiate(oldSky);
                        profile.components.Add(sky);
                    }
                    if (oldProfile.TryGet(out VisualEnvironment oldVisualEnv))
                    {
                        visualEnvironment = Object.Instantiate(oldVisualEnv);
                        profile.components.Add(visualEnvironment);
                    }

                    CoreUtils.Destroy(oldProfile);
                }
                else
                {
                    visualEnvironment = profile.Add <VisualEnvironment>();
                    visualEnvironment.skyType.Override((int)SkyType.HDRI);
                    visualEnvironment.skyAmbientMode.Override(SkyAmbientMode.Dynamic);
                    sky = profile.Add <HDRISky>();
                }

                return(true);
            }
            else
            {
                visualEnvironment = null;
                sky = null;
                return(false);
            }
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Sets the new HDRP volume
 /// </summary>
 /// <param name="profile"></param>
 public void SetNewHDRPEnvironmentVolume(VolumeProfile profile)
 {
     HDRPVolumeProfile = profile;
     if (!IsUnderwater)
     {
         UpdateSurfaceFogSettings();
     }
 }
Ejemplo n.º 20
0
    public static void Initialize(Volume ppVolume)
    {
        volume  = ppVolume;
        profile = volume.profile;

        profile.TryGet(out colours);
        profile.TryGet(out chromatic);
    }
Ejemplo n.º 21
0
    void Start()
    {
        v = GameObject.FindGameObjectWithTag("PP").GetComponent <Volume>()?.profile;
        v.TryGet(out vg);

        StartVgBack();
        aM = AudioManager.instance;
    }
Ejemplo n.º 22
0
 void Start()
 {
     _currentManager  = GameManager.currentManager;
     _tutorialManager = _currentManager._tutorialManager;
     //GameManager.onTurnEnd += NewCycle;
     _volumeProfile = postProcessing.sharedProfile;
     ChangeState();
 }
Ejemplo n.º 23
0
 void GetVolumetricCloudVolume(VolumeProfile profile, out VolumetricClouds volumetricClouds)
 {
     volumetricClouds = null;
     if (profile != null)
     {
         profile.TryGet <VolumetricClouds>(out volumetricClouds);
     }
 }
Ejemplo n.º 24
0
 // Start is called before the first frame update
 void Start()
 {
     volumeProfile = GetComponent <Volume>().profile;
     volumeProfile.TryGet(out liftGammaGain);
     volumeProfile.TryGet(out motionBlur);
     volumeProfile.TryGet(out bloom);
     volumeProfile.TryGet(out vignette);
 }
Ejemplo n.º 25
0
 public void DestroyProfileCopy()
 {
     if (mProfileCopy != null)
     {
         RuntimeUtility.DestroyObject(mProfileCopy);
     }
     mProfileCopy = null;
 }
        void IDataProvider.FirstInitScene(StageRuntimeInterface SRI)
        {
            Camera camera = SRI.camera;

            camera.allowHDR = true;

            var additionalCameraData = camera.gameObject.AddComponent <HDAdditionalCameraData>();

            additionalCameraData.clearColorMode       = HDAdditionalCameraData.ClearColorMode.Color;
            additionalCameraData.clearDepth           = true;
            additionalCameraData.backgroundColorHDR   = camera.backgroundColor;
            additionalCameraData.volumeAnchorOverride = camera.transform;
            additionalCameraData.volumeLayerMask      = 1 << 31; //31 is the culling layer used in LookDev

            Light light = SRI.sunLight;
            HDAdditionalLightData additionalLightData = light.gameObject.AddComponent <HDAdditionalLightData>();

#if UNITY_EDITOR
            HDAdditionalLightData.InitDefaultHDAdditionalLightData(additionalLightData);
#endif
            additionalLightData.intensity = 0f;
            additionalLightData.SetShadowResolution(2048);

            GameObject volumeGO = SRI.AddGameObject(persistent: true);
            volumeGO.name = "SkyManagementVolume";
            Volume volume = volumeGO.AddComponent <Volume>();
            volume.isGlobal = true;
            volume.priority = float.MaxValue;
            VolumeProfile profile = ScriptableObject.CreateInstance <VolumeProfile>();
            volume.sharedProfile = profile;

            HDShadowSettings shadows = profile.Add <HDShadowSettings>();
            shadows.maxShadowDistance.Override(25f);
            shadows.cascadeShadowSplitCount.Override(2);

            VisualEnvironment visualEnvironment = profile.Add <VisualEnvironment>();
            visualEnvironment.fogType.Override(FogType.None);

            HDRISky sky = profile.Add <HDRISky>();

            SRI.SRPData = new LookDevDataForHDRP()
            {
                additionalCameraData = additionalCameraData,
                additionalLightData  = additionalLightData,
                visualEnvironment    = visualEnvironment,
                sky    = sky,
                volume = volume
            };

            //[TODO: remove]
            //temp for debug: show component in scene hierarchy
            //UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene(camera.gameObject, GameObject.Find("Main Camera").scene);
            //camera.gameObject.hideFlags = HideFlags.None;
            //UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene(volumeGO, GameObject.Find("Main Camera").scene);
            //volumeGO.hideFlags = HideFlags.None;
            //UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene(light.gameObject, GameObject.Find("Main Camera").scene);
            //light.gameObject.hideFlags = HideFlags.None;
        }
    private void Awake()
    {
        volumeProfile = GetComponent <Volume>().profile;

        if (PlayVisualFX == null)
        {
            PlayVisualFX = this;
        }
    }
Ejemplo n.º 28
0
    // Start is called before the first frame update
    void Start()
    {
        VolumeProfile volumeProfile = GetComponent <Volume>().profile;

        if (!volumeProfile.TryGet(out vignette))
        {
            throw new System.NullReferenceException(nameof(vignette));
        }
    }
        bool UpdateVolumeProfile(Volume volume, out VisualEnvironment visualEnvironment, out HDRISky sky)
        {
            HDRenderPipelineAsset hdrpAsset = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset;
            if (hdrpAsset.defaultLookDevProfile == null)
                hdrpAsset.defaultLookDevProfile = hdrpAsset.renderPipelineEditorResources.lookDev.defaultLookDevVolumeProfile;

            int newHashCode = hdrpAsset.defaultLookDevProfile.GetHashCode();
            if (newHashCode != m_LookDevVolumeProfileHash)
            {
                VolumeProfile oldProfile = volume.sharedProfile;

                m_LookDevVolumeProfileHash = newHashCode;

                VolumeProfile profile = ScriptableObject.Instantiate(hdrpAsset.defaultLookDevProfile);
                volume.sharedProfile = profile;

                // Remove potentially existing components in the user profile.
                if (profile.TryGet(out visualEnvironment))
                    profile.Remove<VisualEnvironment>();

                if (profile.TryGet(out sky))
                    profile.Remove<HDRISky>();

                // If there was a profile before we needed to re-instantiate the new profile, we need to copy the data over for sky settings.
                if (oldProfile != null)
                {
                    if (oldProfile.TryGet(out HDRISky oldSky))
                    {
                        sky = Object.Instantiate(oldSky);
                        profile.components.Add(sky);
                    }
                    if (oldProfile.TryGet(out VisualEnvironment oldVisualEnv))
                    {
                        visualEnvironment = Object.Instantiate(oldVisualEnv);
                        profile.components.Add(visualEnvironment);
                    }

                    CoreUtils.Destroy(oldProfile);
                }
                else
                {
                    visualEnvironment = profile.Add<VisualEnvironment>();
                    visualEnvironment.skyType.Override((int)SkyType.HDRI);
                    visualEnvironment.skyAmbientMode.Override(SkyAmbientMode.Dynamic);
                    sky = profile.Add<HDRISky>();
                }

                return true;
            }
            else
            {
                visualEnvironment = null;
                sky = null;
                return false;
            }
        }
Ejemplo n.º 30
0
 private void OnEnable()
 {
     PlayerCollision.PlayerLostEvent += DoLossBlur;
     RespawnScript.RespawnEvent      += DoLossBlur;
     PlayerCollision.RestartEvent    += RemoveAllEffects;
     PlayerCollision.WinEvent        += DoWinEffect;
     _pfx = postfx.gameObject.GetComponent <Volume>();
     _vP  = _pfx.profile;
     _colorAdjustments = _vP.components[1] as ColorAdjustments;
 }