public void LoadData() { if (transData == null) { GameObject obj = GameObject.FindGameObjectWithTag("TransitionData"); transData = obj.GetComponentInChildren <DataTransition>(); } if (levelConfig == null) { levelConfig = SingletonJsonLoadable <ConfigurationLevelDataPair> .Instance; } levelConfig.Configure("LevelData/" + transData.nextLevelPath, "LevelData/" + transData.nextLevelPath); levelConfig.Load(); startingMoment = levelConfig.data.startingMoment; startingMoment.BuildLevel(levelConfig.data.levelAsString); moments = new List <List <LevelMoment> >(); List <LevelMoment> startingTimeline = new List <LevelMoment> { startingMoment.DeepCopyLevelMoment() }; moments.Add(startingTimeline); }
private void Start() { settings = SingletonJsonLoadable <SettingsGameDataPairs> .Instance; music = transform.GetComponentInChildren <AudioSource>(); baseVol = music.volume; SetVolume(); StartMusic(); }
public void Configure() { loadable = SingletonJsonLoadable <T> .Instance; if (loadable.IsConfigured()) { return; } loadable.Configure(path, pathBkp); //Throw error if not configured }
private void OnEnable() { settings = SingletonJsonLoadable <SettingsGameDataPairs> .Instance; sound = GetComponentInChildren <AudioSource>(); startSound = sound.volume; if (!onAwake) { return; } PlaySound(); }
private void ActivateButtons() { start.SetActive(true); //load.SetActive(true); SingletonJsonLoadable <DataGameDataPairs> gameData = SingletonJsonLoadable <DataGameDataPairs> .Instance; string path = gameData.data.lastLevel; if (path != "") { contine.SetActive(true); contine.GetComponent <StartGameplayButtonMenu>().path = gameData.data.lastLevel; } }
private void SetupData() { settings = SingletonJsonLoadable <SettingsGameDataPairs> .Instance; exit.onClick.AddListener(() => settings.Save()); }
private void SetupLevelList() { levelList = SingletonJsonLoadable <LevelsGameDataPairs> .Instance; }