playMaker

Author Topic: Ambient Sky Intensity  (Read 2646 times)

zelmund

  • Playmaker Newbie
  • *
  • Posts: 18
Ambient Sky Intensity
« on: November 14, 2017, 04:15:02 AM »
hi there.
missing an option for "Ambient sky intensity" https://docs.unity3d.com/ScriptReference/RenderSettings-ambientIntensity.html

so i did myself one for this using copy/paste and some edit strokes:

Code: [Select]
using UnityEngine;
 using UnityEngine.Rendering;
 
 
 namespace HutongGames.PlayMaker.Actions
 {
  [ActionCategory(ActionCategory.RenderSettings)]
  [Tooltip("Sets the RenderSettings Ambient Sky Intensity.")]
  public class SetAmbientSkyIntensity : FsmStateAction
  {
  [RequiredField]
  [Tooltip("The Ambient Sky Intensity")]
  public FsmFloat ambientSkyIntensity;
 
 
  [Tooltip("Repeats every frame")]
  public bool everyFrame;
 
 
 
 
  public override void Reset()
  {
  ambientSkyIntensity = null;
  everyFrame = false;
  }
 
 
  public override void OnEnter()
  {
  DoSetAmbientSkyIntensity();
 
 
  if (!everyFrame) {
  Finish();
  }
  }
 
 
  public override void OnUpdate()
  {
  DoSetAmbientSkyIntensity();
  }
 
 
 
  void DoSetAmbientSkyIntensity()
  {
 
            RenderSettings.ambientIntensity = ambientSkyIntensity.Value;
  }
  }
 }

could you please add this to echo system? i just wont loose it. usefull for making weather system.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15602
  • Official Playmaker Support
Re: Ambient Sky Intensity
« Reply #1 on: November 22, 2017, 02:19:16 AM »
Hi,

 ok, this is up, thanks :)

I renamed it for consistency and I did a getter and setter.

 Bye,

 Jean