Closed SirRorick closed 1 year ago
The error is: Assets\Scripts\SC1.cs(15,13): error CS0120: An object reference is required for the non-static field, method, or property 'LevelLightmapData.LoadLightingScenario(int)'
But I assume this is irrelevant because I am doing it wrong anyway.
Solved after a few hours of trial and error + countless searches. (I have a better understanding now)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SC1 : MonoBehaviour
{
public LevelLightmapData lightData;
public void OnTriggerEnter(Collider other)
{
lightData.LoadLightingScenario(0);
}
}
Hello, Sorry I couldn't reply fast enough to help you out. I'm glad you found how to use it. This is probably a very good example code I could include in the readme file in the future.
I know this is a dumb question, but I can't seem to get this to work. What is the C# script to call a baked lightmap?
Instructions say "Call the public method LoadLightingScenario using an integer argument that represents the index of the lighting scenario"
I am not understanding how to achieve this, as I am trying the following:
I was able to get the rest of this working, I was able to add new scenes, and now I just need them to change upon collision with the script above. Thank you, and again, and I apologize for this dumb question. I know it is going to be something simple. (And I did search existing tickets/readme here and found nothing)