Hi guys, I have spent all day trying to make a script that I can use outside of Playmaker, but interact with Global variables etc I am not great with scripts, which is why I love Playmaker! What I am trying to do is create a new lightmap array to contain two light maps. i would then like to use a texture, that is loaded to a global variable in playmaker, that I have downloaded and loaded from an assetbundle. I think I have the array being created correctly, but now I need to load the texture into the array. Before I get that far, I am struggling to get the fmsTexture part of the scrip to work. The texture will need to be a Texture2D in order for the script to compile. I have posted my script below, please note i have removed my attempts at converting the texture to a Texture2D and have put it back to an earlier revision but it still doesn't compile because I cannot convert type to Texture this way either. Any help would be much appreciated
using UnityEngine;
using System.Collections;
using HutongGames.PlayMaker;
public class Lightmaps : MonoBehaviour
{
private FsmTexture getlightmapFsmTex;
private Texture Lightmap;
void Start( )
{
getlightmapFsmTex = FsmVariables.GlobalVariables.GetFsmTexture("Lightmap");
Lightmap = getlightmapFsmTex;
}
private void LightMapArray ()
{
LightmapData[] lightmapData = new LightmapData[2];
for(int i = 0 ; i < 2 ; i++ )
lightmapData[i] = new LightmapData();
for( int i = 0 ; i < 2 ; i++ )
{
lightmapData[i].lightmapFar = Lightmap;
}
LightmapSettings.lightmaps = lightmapData;
}
}