void Awake() { if (info == null) { DontDestroyOnLoad(this.gameObject); info = this; } else if (info != this) { Destroy(this.gameObject); return; } SceneManager.sceneLoaded += OnSceneLoad; //TODO: Use playerinfo for money instead of Values dataPath = Application.persistentDataPath + "/gameData.dat"; //File.Delete(dataPath); LoadData(); mainPalette = ChooseMainColorPalette(accentPalette); mainColors = MaterialColors.GetColorPalette(mainPalette); accentColors = MaterialColors.GetColorPalette(accentPalette); PlayerController activeShape = allPlayerShapes[activePlayerShapeIndex]; basicSpeed = activeShape.speed; basicDodgeSpeed = activeShape.dodgeSpeed; basicSpeedUpCoefficient = activeShape.speedUpCoefficient; basicHitPointsMax = activeShape.hitPointsMaximum; basicStartHitPoints = activeShape.hitPoints; }
public void OnSceneLoad(Scene scene, LoadSceneMode sceneMode) { SaveData(); if (wasAcPaletteChanged) { accentColors = MaterialColors.GetColorPalette(accentPalette); wasAcPaletteChanged = false; } mainPalette = ChooseMainColorPalette(accentPalette); mainColors = MaterialColors.GetColorPalette(mainPalette); }