Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void InitLightmaps( )
- {
- LightmapData[] lightmapData = new LightmapData[YourlightmapNumber];
- for(int i = 0 ; i < YourlightmapNumber ; i++ )
- lightmapData[i] = new LightmapData();
- for( int i = 0 ; i < YourlightmapNumber ; i++ )
- {
- Debug.Log("Lightmap and path : Yourlightmapfolder/LightmapFar-" + i.ToString() );
- lightmapData[i].lightmapFar = Resources.Load( "LightmapsCZC/LightmapFar-" + i.ToString(), typeof(Texture2D)) as Texture2D;
- }
- LightmapSettings.lightmaps = lightmapData;
- }
- ///// Other part of code to hide lightmaps ///////
- if( bIsTimeToHideLM )
- {
- //Create another empty lightmapData array
- //Do this : LightmapSettings.lightmaps = YourNewEmptyArray
- }
- else
- {
- //If you are here so the waiting time is over
- //Do this : LightSettings.lightmaps = YourTrueLightmapArray
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement