I currently have a GameManager that holds a List of levels. I have a LevelManager that when it starts will get the currentLevel from the GameManager which is an instantiated clone of the level that is selected. I have an array of WordLengthRequirements(scriptable object) that gets changed when an objective is completed. For some reason when I modify the array objects is changes the List of levels object that was originally cloned. but only the array of WordLengthRequirements. All other variables are seperate and are always seperate.
When I modify currentLevel(Level).wordLengthRequirement it changes the original levels array object. but not when I change something like the name of the currentLevel. I hope this makes sense to you guys and I appreciate your help.
public class WordLengthRequirement : ScriptableObject {
public int length = 0;
public int count;
}
public class Level : ScriptableObject
{
public WordLengthRequirement[] wordLengthRequirement;
}
//from gameManager Script
currentLevel = Instantiate(levels*) as Level;*