how would i fix the compiler errors
using System;
using UnityEngine;
using UnityStandardAssets.ImageEffects;
[ExecuteInEditMode]
public class ColorGradingProperties : ObjectProperties {
private Tonemapping toneMapping;
//public Light _moon;
public Gradient exposure;
//public Gradient exposure, brightness,contrast,saturation;
public Vector2 exposure2 = new Vector2(1, 2), brightness2 = new Vector2(1, 1), contrast2 = new Vector2(1, 1.1f), saturation2 = new Vector2(0, 1);
public float crossFade;
public new void Awake() {
toneMapping = GetComponent<Tonemapping>();
base.Awake();
}
public override void Run() {
if (!enabled) return;
UpdateTone(time);
}
public void Update() {}
//public new void OnEnable() {
// if(debugLogness)Debug.Log("ColorGrading OnEnable");
// UpdateTone(time);
// base.OnEnable();
//}
private void UpdateTone(float timeIn) {
if (debugLogness) Debug.Log("ColorGrading UpdateTone: time:" + timeIn + " crossFade:" + crossFade + " :" + toneMapping, this);
if (toneMapping == null) toneMapping = GetComponent<Tonemapping>();
var crossTo = 0f;
var crossFade2 = crossFade;
if (crossFade < 0) {
crossTo = 30;
crossFade2 = -crossFade;
}
if (exposure != null) toneMapping.exposureAdjustment = Mathf.Lerp(Mathf.Lerp(exposure2.x, exposure2.y, exposure.Evaluate(timeIn).r), crossTo, crossFade2);
if (exposure != null) toneMapping.Brightness = Mathf.Lerp(brightness2.x, brightness2.y, exposure.Evaluate(timeIn).r);
//if (exposure != null) toneMapping.Brightness = Mathf.Lerp(Mathf.Lerp(brightness2.x, brightness2.y, exposure.Evaluate(timeIn).r), Mathf.Lerp(brightness2.x, brightness2.y, exposure.Evaluate(timeIn).r)*0.0f, Mathf.Max(0, crossFade*2f - 0.5f));
if (exposure != null) toneMapping.Contrast = Mathf.Lerp(Mathf.Lerp(contrast2.x, contrast2.y, exposure.Evaluate(timeIn).r), 1f, crossFade);
if (exposure != null) toneMapping.Saturation = Mathf.Lerp(saturation2.x, saturation2.y, exposure.Evaluate(timeIn).r);
}
}
this is what was there and i attempted to fix it but after i did it continued to say there were errors these were the errors Assets/Scripts/Properties/ColorGradingProperties.cs(45,51): error CS1061: Type UnityStandardAssets.ImageEffects.Tonemapping' does not contain a definition for
Brightness' and no extension method Brightness' of type
UnityStandardAssets.ImageEffects.Tonemapping' could be found (are you missing a using directive or an assembly reference?)
Assets/Scripts/Properties/ColorGradingProperties.cs(48,51): error CS1061: Type UnityStandardAssets.ImageEffects.Tonemapping' does not contain a definition for
Contrast' and no extension method Contrast' of type
UnityStandardAssets.ImageEffects.Tonemapping' could be found (are you missing a using directive or an assembly reference?)
Assets/Scripts/Properties/ColorGradingProperties.cs(49,51): error CS1061: Type UnityStandardAssets.ImageEffects.Tonemapping' does not contain a definition for
Saturation' and no extension method Saturation' of type
UnityStandardAssets.ImageEffects.Tonemapping' could be found (are you missing a using directive or an assembly reference?
The type 'UnityStandardAssets.ImageEffects.Tonemapping' simply does not have such properties. Where did you get this script from? Or what did you change when you tried to fix in on your own?
you try to access the three properties Brightness, Contrast, Saturation, which seem to not exist in the class Tonemapping. If you type in "tonemapping." and then hit C$$anonymous$$D + Space, autocompletion should help you finding out what you can and can't do with the class unless you wrote it yourself.
Your answer
Follow this Question
Related Questions
[Ubuntu 19.10] Blank error at project start 2 Answers
,Cannot Enter Play Mode when I download assets from assets store 1 Answer
how do i fix the compiler errors on unity 5? i have tried everything there is to try. 0 Answers
Error: Cannot start process because a file name had not been provided 0 Answers
I'm getting an error o != NULL UnityEditor.DockArea:OnGUI() 0 Answers