Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: vrpostcard on September 07, 2013, 11:40:15 AM
-
Could somebody please explain why I can't use the Set Properties action to change the float values as listed below? My current knowledge of coding is zero although I can usually manage to work most things out with playmaker, but this one has me stumped.
When I drag this script into my FSM and as Set Properties, these parameters do not show up so that I can change them. The parameters appear in the unity editor and I am able to change them there.
using UnityEngine;
using System;
[ExecuteInEditMode]
public class TOD_Sky : MonoBehaviour
{
[Serializable]
public class CycleParameters
{
public float TimeOfDay = 12f;
public float JulianDate = 60f;
public float Latitude = 0f;
public float Longitude = 0f;
public float UTC = 0f;
}
Many thanks in advance.
-
I assume you declare a public field of type CycleParameters?
Do you see that field name in Set Property?
The CycleParameters parameters should be nested inside...
-
Alex, thanks for your reply. I'm not quite sure what you are talking about but I'll see if I can read up on the subject. It seems to make sense that the variable are not being made public.
The script sample I provided is the very start of the script that I am trying to change the values in and other than the floats being made public which I assumed would make then visible to the Set Properties action I can kind of see the logic you have put forward.
-
The code snippet declares a class. Later you must have: public CycleParameters [parameterName]
Look for that parameter name.
-
Alex,
Further down in the script is :
// Component references
// These are already setup in the prefab
public GameObject SunInstance = null;
public GameObject MoonInstance = null;
public GameObject AtmosphereInstance = null;
public GameObject CloudInstance = null;
public GameObject SpaceInstance = null;
public GameObject ProjectorInstance = null;
// Color space (can be linear or gamma)
// This has to be set by the user
public bool LinearLighting = false;
// Dome parameters
public CycleParameters Cycle = null;
public DayParameters Day = null;
And I can change the LinearLighting bool through Set Properties. The SunInstance (and others in that group) shows in the list (nested as you suggest) but not the CycleParameters.
-
And you don't see a property called Cycle in the Set Property menu?
-
No. I can't see it at all. It really has me stumped.
-
I'll try to recreate the setup here and see what I get...
-
That would be great, many thanks for your help.
-
Alex, I've also tried using the send message action with zero results. Still working on other options!