- Home /
Apply Configuration Files/Custom Stored Assets when Selecting a Level?
This question is more of a continuation of my last post
I've created a Main Menu with a Scene to select which level you want to play. When you choose a level, you get the option to play at night or daytime. I've followed and fixed all the errors of the tutorial in the last post. I've made it VERY basic at the moment, having just the skyboxes and fog change.
How do I apply it though? I've placed it on a Main Camera and press play, but the skybox does not change and the fog does not activate. (I'm much newer to C# than Javascript) Here's the script:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[System.Serializable]
public class LevelElement
{
public enum Levels{ Night, Day, Storm };
//public enum AvatarPos{ left, right};
public Levels Level;
//public AvatarPos CharacterPosition;
//public Texture2D LevelPic;
//public string DialogueText;
//public GUIStyle DialogueTextStyle;
//public float TextPlayBackSpeed;
//public AudioClip PlayBackSoundFile;
public Material dayMaterial;
public Material nightMaterial;
void LevelSelection(){
RenderSettings.skybox = nightMaterial;
//RenderSettings.skybox = dayMaterial;
RenderSettings.fog = true;
//RenderSettings.fog = false;
}
}
public class Level: ScriptableObject
{
public List<LevelElement> LevelItems = new List<LevelElement> ();
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613133845im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Load Scene. Efficiency question 3 Answers
Load the Same Level, but Different Configurations? 2 Answers
Delays when move to another scene 1 Answer
Next lvl code help 1 Answer
level load problem 2 Answers