So I have this piece of code here, and I’m getting an error accessing to this struct vars because of its level of protection.
I want to avoid making anything public if it is not completely necessary, and tried making these vars internal without success.
I’m not an expert in C#, so I come here to ask for help. Any idea of how making this work?
public class Clock : MonoBehaviour
{
[System.Serializable]
private struct GameTime
{
private static int day = 0;
private static int hour = 0;
}
[SerializeField] private GameTime gameTime;
public void SetDay(int day)
{
gameTime.day = day;
}