Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: ubernurbs on June 20, 2018, 07:25:05 AM
-
How to set RenderSettings.customReflection in an action?
How do I input a cubemap, I can't use FsmTexture, is it possible to set the object type of an FsmObject in an action?
Cheers
-
can each setting be a separate material? you can set object material that should give you what you want with a little fiddling?
-
I would like it to be a simple action like this:
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.RenderSettings)]
[Tooltip("Set Custom Reflection.")]
public class SetCustomReflection : FsmStateAction
{
// This won't work as the input should be CubeMap
public FsmTexture customReflection;
[Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset()
{
customReflection = null;
}
public override void OnEnter()
{
RenderSettings.customReflection = customReflection.Value;
if (!everyFrame)
{
Finish();
}
}
public override void OnUpdate()
{
RenderSettings.customReflection = customReflection.Value;
}
}
}
How do I get the Cubemap in a useable variable?