playMaker

Author Topic: RenderSettings.customReflection  (Read 1604 times)

ubernurbs

  • Playmaker Newbie
  • *
  • Posts: 11
RenderSettings.customReflection
« 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

verybinary

  • Junior Playmaker
  • **
  • Posts: 81
    • The Museum of Digital
Re: RenderSettings.customReflection
« Reply #1 on: June 20, 2018, 03:49:13 PM »
can each setting be a separate material? you can set object material that should give you what you want with a little fiddling?

ubernurbs

  • Playmaker Newbie
  • *
  • Posts: 11
Re: RenderSettings.customReflection
« Reply #2 on: June 20, 2018, 06:11:18 PM »
I would like it to be a simple action like this:

Code: [Select]
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?