5 protected float m_AccumulatedTime = 0;
6 protected bool m_FadeIn =
false;
7 protected bool m_FadeOut =
false;
9 const float FADE_TIME = 3;
11 const float R_TARGET = 0.60;
12 const float G_TARGET = 0.28;
13 const float B_TARGET = 0.07;
19 m_AccumulatedTime = 0;
32 if (m_FadeIn && m_AccumulatedTime <= FADE_TIME)
34 m_AccumulatedTime +=
delta;
36 m_StartRGB[0] = 1 - FadeColourMult(0, 1, m_AccumulatedTime / FADE_TIME) * R_TARGET;
37 m_StartRGB[1] = 1 - FadeColourMult(0, 1, m_AccumulatedTime / FADE_TIME) * G_TARGET;
38 m_StartRGB[2] = 1 - FadeColourMult(0, 1, m_AccumulatedTime / FADE_TIME) * B_TARGET;
45 if (m_AccumulatedTime <= FADE_TIME)
47 m_AccumulatedTime +=
delta;
49 m_StartRGB[0] = (1 - R_TARGET) + FadeColourMult(0, R_TARGET, m_AccumulatedTime / FADE_TIME);
50 m_StartRGB[1] = (1 - G_TARGET) + FadeColourMult(0, G_TARGET, m_AccumulatedTime / FADE_TIME);
51 m_StartRGB[2] = (1 - B_TARGET) + FadeColourMult(0, B_TARGET, m_AccumulatedTime / FADE_TIME);
71 m_AccumulatedTime = 0;
void Stop()
Stops all elements this effect consists of.
PPOperators
PP operators, specify operation between subsequent layers.
Super root of all classes in Enforce script.
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
static float EaseInOutSine(float t)
FilmGrain - PostProcessEffectType.FilmGrain.
static const int L_1_TOXIC_TINT
static const int PARAM_SHARPNESS
static const int L_2_TOXIC_TINT
static const int PARAM_GRAINSIZE
Glow - PostProcessEffectType.Glow.
static const int PARAM_COLORIZATIONCOLOR
static const int L_23_TOXIC_TINT
base, not to be used directly, would lead to layering collisions!
override void OnStop(Param par=null)
float FadeColourMult(float x, float y, float deltaT)
void OnStart(Param par=null)
void OnUpdate(float delta)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
PostProcessEffectType
Post-process effect type.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.