Hi,
I found this action in the forums and it targets the exposure of the procedural skybox. The only problem with it is that it only sets the exposure with a static number and does not have the option of using a variable.
I would like to modify the code to allow for the use of a float variable for the exposure.
I do not know much of anything about code, and though I've been trying to figure this out for hours I've had no luck. Any help would be greatly appreciated.
Here is the code.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Skybox")]
[Tooltip("Allows Adjustment of Procedural Skybox")]
public class SkyBoxAdjust : FsmStateAction
{
public Material ProceduralSkyBox;
public bool everyFrame;
public float exposure;
public override void Reset()
{
ProceduralSkyBox = null;
everyFrame = false;
}
public override void OnEnter()
{
if (ProceduralSkyBox != null && exposure != null)
{
ProceduralSkyBox.SetFloat
("_Exposure",exposure);
}
if (!everyFrame)
{
Finish();
}
}
public override void OnUpdate()
{
if (ProceduralSkyBox != null && exposure != null)
{
ProceduralSkyBox.SetFloat
("_Exposure",exposure);
}
}
}
}