void Start()
    {
        cam = GetComponent <Camera> ();

        m_Profile = GameObject.Find("Global Volume").GetComponent <PostProcessVolume> ().profile;
        m_Profile.TryGetSettings(out dof);

        doFFocusTarget = new GameObject("DoFFocusTarget");
        //  var behaviour = GetComponent<PostProcessingBehaviour>();
        // m_Profile = behaviour.profile;
    }
Пример #2
0
    void Awake()
    {
        instance = this;
        startPos = transform.position;

        PostProcessVolume volume = GetComponentInChildren <PostProcessVolume>();

        profile = volume.profile;

        chromaticAberration = profile.GetSetting <ChromaticAberration>();
    }
Пример #3
0
        private static void RemoveDepthOfField(Action <PostProcessProfile> orig, PostProcessProfile self)
        {
            orig(self);

            DepthOfField dofSetting = self.GetSetting <DepthOfField>();

            if (dofSetting)
            {
                dofSetting.active = false;
            }
        }
 void Start()
 {
     Cursor.visible       = false;
     postVolume           = Camera.main.GetComponentInChildren <PostProcessVolume>();
     postProfile          = postVolume.profile;
     ui                   = GetComponent <InterfaceAnimator>();
     anim                 = this.GetComponent <Animator>();
     input                = GetComponent <MovementInput>();
     originalFOV          = thirdPersonCamera.m_Lens.FieldOfView;
     originalCameraOffset = thirdPersonCamera.GetRig(1).GetCinemachineComponent <CinemachineComposer>().m_TrackedObjectOffset;
 }
Пример #5
0
        public static PostProcessProfile Clone(this PostProcessProfile profile)
        {
            PostProcessProfile profileClone = ScriptableObject.CreateInstance <PostProcessProfile>();

            foreach (var setting in profile.settings)
            {
                var settingClone = Object.Instantiate(setting);
                profileClone.settings.Add(settingClone);
            }
            return(profileClone);
        }
Пример #6
0
        private void ggop()
        {
            if (Profile.Value != null)
            {
                convert = (PostProcessProfile)Profile.Value;
            }
            else if (Volume.Value != null)
            {
                convert2            = (PostProcessVolume)Volume.Value;
                convert             = convert2.profile;
                VolumeProfile.Value = convert;
            }
            if (convert == null)
            {
                return;
            }
            else
            {
                convert.TryGetSettings(out Vignette vignette);

                if (!EnableValue.IsNone)
                {
                    EnableValue.Value = vignette.active;
                }
                if (!ModeValue.IsNone)
                {
                    ModeValue.Value = vignette.mode.overrideState;
                }
                if (!ColorValue.IsNone)
                {
                    ColorValue.Value = vignette.color.overrideState;
                }
                if (!CenterValue.IsNone)
                {
                    CenterValue.Value = vignette.center.overrideState;
                }
                if (!IntensityValue.IsNone)
                {
                    IntensityValue.Value = vignette.intensity.overrideState;
                }
                if (!SmoothnessValue.IsNone)
                {
                    SmoothnessValue.Value = vignette.smoothness.overrideState;
                }
                if (!RoundnessValue.IsNone)
                {
                    RoundnessValue.Value = vignette.roundness.overrideState;
                }
                if (!RoundedValue.IsNone)
                {
                    RoundedValue.Value = vignette.rounded.overrideState;
                }
            }
        }
Пример #7
0
    void Start()
    {
        rotationXValue = transform.rotation.eulerAngles.x;
        mainCamera     = Camera.main;
        if (followEntity == null)
        {
            followEntity = GameManager.GetPlayerTransform();
        }

        sceneVolume    = GameObject.FindGameObjectWithTag(SCENE_VOLUME_TAG).GetComponent <PostProcessVolume>();
        defaultProfile = sceneVolume.profile;
    }
 void RefreshEffectListEditor(PostProcessProfile asset)
 {
     if (m_EffectList == null)
     {
         m_EffectList = new EffectListEditor(this);
     }
     m_EffectList.Clear();
     if (asset != null)
     {
         m_EffectList.Init(asset, new SerializedObject(asset));
     }
 }
Пример #9
0
    public void Kill()
    {
        m_postProcessVolumn      = null;
        m_targetProfile          = null;
        m_postProcessProfileLerp = null;

        if (m_tweener != null)
        {
            m_tweener.Kill();
            m_tweener = null;
        }
    }
Пример #10
0
 void setVignette()
 {
     UsedProfile = ObjectProfile.Value as PostProcessProfile;
     UsedProfile.TryGetSettings(out VignetteLayer);
     if (ObjectProfile.Value != null & UsedProfile.HasSettings <Vignette>())
     {
         if (VignetteLayer != null)
         {
             VignetteLayer.active             = ActiveLayer.Value;                 //Active AO Layer
             VignetteLayer.enabled.value      = ActiveEffect.Value;                // Active AO Effect
             VignetteLayer.mode.overrideState = ModeActive.Value;                  //Activate mode
             if (ModeActive.Value)
             {
                 VignetteLayer.mode.value = Mode;                                 // mode
             }
             VignetteLayer.color.overrideState = ActivateColor.Value;             //Activate color
             if (ActivateColor.Value)
             {
                 VignetteLayer.color.value = VignetteColor.Value;                              // color
             }
             VignetteLayer.mask.overrideState = ActivateMask.Value;                            //Activate Mask
             if (ActivateMask.Value)
             {
                 VignetteLayer.mask.value = Mask.Value;                                 // Mask
             }
             VignetteLayer.center.overrideState = ActivateCenter.Value;                 //Activate center
             if (ActivateCenter.Value)
             {
                 VignetteLayer.center.value = Center.Value;                                 // center
             }
             VignetteLayer.intensity.overrideState = ActivateIntensity.Value;               //Activate intensity
             if (ActivateIntensity.Value)
             {
                 VignetteLayer.intensity.value = Intensity.Value;                                 // intensity
             }
             VignetteLayer.smoothness.overrideState = ActivateSmoothness.Value;                   //Activate Smoothness
             if (ActivateSmoothness.Value)
             {
                 VignetteLayer.smoothness.value = Smoothness.Value;                                 // Smoothness
             }
             VignetteLayer.roundness.overrideState = ActivateRoundness.Value;                       //Activate Roundness
             if (ActivateRoundness.Value)
             {
                 VignetteLayer.roundness.value = Roundness.Value;                                 // Roundness
             }
             VignetteLayer.rounded.overrideState = ActivateRounded.Value;                         //Activate Rounded
             if (ActivateRounded.Value)
             {
                 VignetteLayer.rounded.value = Rounded.Value;                                 // Rounded
             }
         }
     }
 }
        public override void Reset()
        {
            Profile  = null;
            convert  = null;
            convert2 = null;

            //GetEnable = false;
            //GetShutterAngle = false;
            //GetSampleCount = false;

            everyFrame = false;
        }
        private void ggop()
        {
            if (Profile.Value != null)
            {
                convert = (PostProcessProfile)Profile.Value;
            }
            else if (Volume.Value != null)
            {
                convert2 = (PostProcessVolume)Volume.Value;
                convert  = convert2.profile;
            }
            if (convert == null)
            {
                return;
            }
            else
            {
                convert.TryGetSettings(out Vignette vignette);

                if (SetEnable.Value)
                {
                    vignette.enabled.value = EnableValue.Value;
                }
                if (SetMode.Value)
                {
                    vignette.mode.value = (VignetteMode)ModeValue.Value;
                }
                if (SetColor.Value)
                {
                    vignette.color.value = ColorValue.Value;
                }
                if (SetCenter.Value)
                {
                    vignette.center.value = CenterValue.Value;
                }
                if (SetIntensity.Value)
                {
                    vignette.intensity.value = IntensityValue.Value;
                }
                if (SetSmoothness.Value)
                {
                    vignette.smoothness.value = SmoothnessValue.Value;
                }
                if (SetRoundness.Value)
                {
                    vignette.roundness.value = RoundnessValue.Value;
                }
                if (SetRounded.Value)
                {
                    vignette.rounded.value = RoundedValue.Value;
                }
            }
        }
Пример #13
0
        private void ggop()
        {
            if (Profile.Value != null)
            {
                convert = (PostProcessProfile)Profile.Value;
            }
            else if (Volume.Value != null)
            {
                convert2 = (PostProcessVolume)Volume.Value;
                convert  = convert2.profile;
            }
            if (convert == null)
            {
                return;
            }
            else
            {
                convert.TryGetSettings(out Vignette vignette);

                if (!ActiveEnable.IsNone)
                {
                    vignette.active = ActiveEnable.Value;
                }
                if (!ActiveMode.IsNone)
                {
                    vignette.mode.overrideState = ActiveMode.Value;
                }
                if (!ActiveColor.IsNone)
                {
                    vignette.color.overrideState = ActiveColor.Value;
                }
                if (!ActiveCenter.IsNone)
                {
                    vignette.center.overrideState = ActiveCenter.Value;
                }
                if (!ActiveIntensity.IsNone)
                {
                    vignette.intensity.overrideState = ActiveIntensity.Value;
                }
                if (!ActiveSmoothness.IsNone)
                {
                    vignette.smoothness.overrideState = ActiveSmoothness.Value;
                }
                if (!ActiveRoundness.IsNone)
                {
                    vignette.roundness.overrideState = ActiveRoundness.Value;
                }
                if (!ActiveRounded.IsNone)
                {
                    vignette.rounded.overrideState = ActiveRounded.Value;
                }
            }
        }
        public override void Reset()
        {
            Profile  = null;
            convert  = null;
            convert2 = null;

            ActiveRoot = new FsmBool {
                UseVariable = true
            };

            ActiveIntensity = new FsmBool {
                UseVariable = true
            };

            ActiveThreshold = new FsmBool {
                UseVariable = true
            };

            ActiveSoftKnee = new FsmBool {
                UseVariable = true
            };

            ActiveClamp = new FsmBool {
                UseVariable = true
            };

            ActiveDiffusion = new FsmBool {
                UseVariable = true
            };

            ActiveAnamorphicRatio = new FsmBool {
                UseVariable = true
            };

            ActiveColor = new FsmBool {
                UseVariable = true
            };

            ActiveFastMode = new FsmBool {
                UseVariable = true
            };

            ActiveDirtTexture = new FsmBool {
                UseVariable = true
            };

            ActiveDirtIntensity = new FsmBool {
                UseVariable = true
            };

            everyFrame = false;
        }
Пример #15
0
    // Start is called before the first frame update
    void Start()
    {
        drunkProfile = GetComponent <PostProcessVolume>().profile;
        drunkProfile.TryGetSettings(out lensDistortion);

        XTarget = Random.Range(0, 2);
        YTarget = Random.Range(0, 2);
        lensDistortion.intensityX.value = Random.Range(0, 1f);
        lensDistortion.intensityY.value = Random.Range(0, 1f);

        lensDistortion.intensity.value = Random.Range(-maxMinIntensity, maxMinIntensity);
        intensityTarget = maxMinIntensity;
    }
Пример #16
0
    private void InitSelf()
    {
        base.mSpeed             = DEFAULT_SPEED;
        base.mLife              = DEFAULT_LIFE;
        this.transform.position = new Vector2(Random.Range(-5.0f, 5.0f), Random.Range(-4.0f, 4.0f));
        this.mScore             = 0;
        this.mSkillMgr          = gameObject.GetComponent <SkillManager>();
        this.mBulletLevel       = 0;
        this.mNextRewardLife    = REWARD_LIFE_CONDITION;
        this.mSkillCDTimer      = 0.0f;

        this.pp = GameWorld.Instance.postProcessProfile;
    }
Пример #17
0
        private void ResetPostProcessProfile()
        {
            if (null != GlobalPostProcessProfile)
            {
                GlobalPostProcessProfile.Destroy();
            }
            GlobalPostProcessProfile = null;

            if (null != _globalPostProcessVolume)
            {
                _globalPostProcessVolume.profile = null;
            }
        }
Пример #18
0
 static bool ProfileIsActive(PostProcessProfile profile, out ImageSpaceModifier mod)
 {
     for (int i = 0; i < activeModifiers.Count; i++)
     {
         if (activeModifiers[i].profile == profile)
         {
             mod = activeModifiers[i];
             return(true);
         }
     }
     mod = null;
     return(false);
 }
Пример #19
0
 public void Update()
 {
     if (Input.GetMouseButtonDown(1) && tutorial.activeSelf)
     {
         time.Resume();
         tutorial.SetActive(false);
         LensDistortion lens;
         profile = postProcProf.sharedProfile;
         profile.TryGetSettings <LensDistortion>(out lens);
         lens.intensity.Override(22f);
         Destroy(gameObject);
     }
 }
Пример #20
0
    IEnumerator pauseDelay()
    {
        yield return(new WaitForSeconds(1f));

        time.Stop();
        attack.SetActive(true);
        LensDistortion lens;

        profile = postProcProf.sharedProfile;
        profile.TryGetSettings <LensDistortion>(out lens);
        lens.intensity.Override(50f);
        secondStage = true;
    }
Пример #21
0
 void Update()
 {
     if ((Input.GetAxis("Horizontal") != 0) || (Input.GetAxis("Vertical") != 0))
     {
         time.Resume();
         panel.SetActive(false);
         LensDistortion lens;
         profile = postProcProf.sharedProfile;
         profile.TryGetSettings <LensDistortion>(out lens);
         lens.intensity.Override(22f);
         Destroy(gameObject);
     }
 }
    void OnEnable()
    {
        var behaviour = GetComponent <PostProcessVolume>();

        if (behaviour.profile == null)
        {
            enabled = false;
            return;
        }

        v = Instantiate(behaviour.profile);
        behaviour.profile = v;
    }
Пример #23
0
        /// <summary>
        /// Returns a Unity PostProcessProfile instance with the settings contained in this TUFXProfile
        /// </summary>
        public PostProcessProfile GetPostProcessProfile()
        {
            PostProcessProfile profile = ScriptableObject.CreateInstance <PostProcessProfile>();
            int len = Settings.Count;

            for (int i = 0; i < len; i++)
            {
                profile.settings.Add(Settings[i]);
            }
            profile.isDirty = true;
            profile.name    = this.ProfileName;
            return(profile);
        }
Пример #24
0
        public static PostProcessProfile Clone(this PostProcessProfile profile)
        {
            PostProcessProfile profileClone = Object.Instantiate(profile);

            profileClone.settings.Clear();
            foreach (PostProcessEffectSettings settings in profile.settings)
            {
                PostProcessEffectSettings settingsClone = Object.Instantiate(settings);
                profileClone.settings.Add(settingsClone);
            }

            return(profileClone);
        }
    private static void ConvertGrainSettings(PostProcessProfile ppp, GrainModel.Settings grain)
    {
        var grain2 = ppp.AddSettings <Grain>();

        grain2.colored.overrideState    = true;
        grain2.colored.value            = grain.colored;
        grain2.intensity.overrideState  = true;
        grain2.intensity.value          = grain.intensity;
        grain2.lumContrib.overrideState = true;
        grain2.lumContrib.value         = grain.luminanceContribution;
        grain2.size.overrideState       = true;
        grain2.size.value = grain.size;
    }
Пример #26
0
    // Called when the owning graph starts playing
    public override void OnGraphStart(Playable playable)
    {
        PostProcessLayer postLayer = null;

        if (Camera.main != null)
        {
            postLayer = Camera.main.gameObject.GetComponentInChildren <PostProcessLayer>();
        }

        if (postLayer == null)
        {
            var allCam = Camera.allCameras;
            foreach (var cam in allCam)
            {
                var pl = cam.gameObject.GetComponentInChildren <PostProcessLayer>();
                if (pl != null)
                {
                    postLayer = pl;
                    break;
                }
            }
        }

        if (postLayer == null)
        {
            return;
        }


        PostProcessVolume  volume  = PostProcessManager.instance.GetHighestPriorityVolume(postLayer);
        PostProcessProfile profile = volume.sharedProfile;

        if (profile == null)
        {
            return;
        }

        blurCtrl = profile.GetSetting <RadialBlur>();
        if (blurCtrl == null)
        {
            blurCtrl = profile.AddSettings <RadialBlur>();
        }

        blurCtrl.enabled.value            = true;
        blurCtrl.center.value             = this.blurCenter;
        blurCtrl.center.overrideState     = true;
        blurCtrl.centerSize.value         = this.centerSize;
        blurCtrl.centerSize.overrideState = true;
        blurCtrl.blurSize.value           = this.blurSizeCur.Evaluate(0f);
        blurCtrl.blurSize.overrideState   = true;
    }
Пример #27
0
    // Start is called before the first frame update
    void Start()
    {
        Cursor.visible = false;

        input             = GetComponent <MovementInput>();
        anim              = GetComponent <Animator>();
        impulse           = cameraFreeLook.GetComponent <CinemachineImpulseSource>();
        postVolume        = Camera.main.GetComponent <PostProcessVolume>();
        postProfile       = postVolume.profile;
        swordOrigRot      = sword.localEulerAngles;
        swordOrigPos      = sword.localPosition;
        swordMesh         = sword.GetComponentInChildren <MeshRenderer>();
        swordMesh.enabled = false;
    }
Пример #28
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.K))
     {
         if (ppp == firstPlayer)
         {
             ppp = GetComponent <PostProcessVolume>().profile = secondPlayer;
         }
         else if (ppp == secondPlayer)
         {
             ppp = GetComponent <PostProcessVolume>().profile = firstPlayer;
         }
     }
 }
Пример #29
0
        private void ggop()
        {
            if (Profile.Value != null)
            {
                convert = (PostProcessProfile)Profile.Value;
            }
            else if (Volume.Value != null)
            {
                convert2            = (PostProcessVolume)Volume.Value;
                convert             = convert2.profile;
                VolumeProfile.Value = convert;
            }
            if (convert == null)
            {
                return;
            }
            else
            {
                convert.TryGetSettings(out LensDistortion lensDistortion);

                if (!EnableValue.IsNone)
                {
                    EnableValue.Value = lensDistortion.active;
                }
                if (!IntensityValue.IsNone)
                {
                    IntensityValue.Value = lensDistortion.intensity.overrideState;
                }
                if (!XMultiplierValue.IsNone)
                {
                    XMultiplierValue.Value = lensDistortion.intensityX.overrideState;
                }
                if (!YMultiplierValue.IsNone)
                {
                    YMultiplierValue.Value = lensDistortion.intensityY.overrideState;
                }
                if (!CenterXValue.IsNone)
                {
                    CenterXValue.Value = lensDistortion.centerX.overrideState;
                }
                if (!CenterYValue.IsNone)
                {
                    CenterYValue.Value = lensDistortion.centerY.overrideState;
                }
                if (!ScaleValue.IsNone)
                {
                    ScaleValue.Value = lensDistortion.scale.overrideState;
                }
            }
        }
Пример #30
0
 void Update()
 {
     if (secondStage)
     {
         if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1))
         {
             time.Resume();
             LensDistortion lens;
             profile = postProcProf.sharedProfile;
             profile.TryGetSettings <LensDistortion>(out lens);
             lens.intensity.Override(22f);
         }
     }
 }