// Start is called before the first frame update void Start() { subinstance = submarineMovement.instance; previousLightStrength = lights[0].intensity; toStart = lights[0].intensity; fromStart = lights[0].intensity; }
private void Start() { diving = false; coll = GetComponent <BoxCollider>(); subInstance = submarineMovement.instance; abilityUI = UIManager.instance.abilityUI; }
public void Awake() { if (instance != null) { return; } instance = this; }
public void SavePlayerData() { PlayerSaveData saveData = new PlayerSaveData(); saveData.levelIdx = SceneManager.GetActiveScene().buildIndex; if (submarineMovement.instance) { submarineMovement subInstance = submarineMovement.instance; saveData.savePosition = subInstance.submarineStats.submarinePosition; saveData.playerHealth = subInstance.submarineStats.health; } else { Debug.LogWarning("can't save player in current state"); } string json = JsonUtility.ToJson(saveData); File.WriteAllText(Application.persistentDataPath + "/saveData.json", json); }