private void Awake() { if (settingsInstance == null) { settingsInstance = getInstance(); } }
void OnEnable() { if (settingsInstance == null) { settingsInstance = getInstance(); } }
public BrawlerLevelSettings getInstance() { if (settingsInstance == null) { TextAsset jsonObj = Resources.Load(Path.Combine("BrawlerJSON", SceneManager.GetActiveScene().name)) as TextAsset; if (jsonObj == null) { settingsInstance = new BrawlerLevelSettings(); } else { settingsInstance = JsonUtility.FromJson <BrawlerLevelSettings>(jsonObj.text); } } return(settingsInstance); }