public void Save() { player.maxHealth = 100 + ((playerStats[0].statValue + playerStats[0].tempValue) * 5); player.maxMana = 100 + ((playerStats[3].statValue + playerStats[3].tempValue) * 5); player.maxStamina = 100 + ((playerStats[1].statValue + playerStats[1].tempValue) * 5); player.currentHealth = player.maxHealth; player.currentMana = player.maxMana; player.currentStamina = player.maxStamina; player.skinIndex = skinIndex; player.hairIndex = hairIndex; player.mouthIndex = mouthIndex; player.eyesIndex = eyesIndex; player.clothesIndex = clothesIndex; player.armourIndex = armourIndex; player.characterClass = characterClass; player.characterName = characterName; for (int i = 0; i < playerStats.Length; i++) { player.stats[i].value = playerStats[i].statValue + playerStats[i].tempValue; } saveNew.BinarySave(); SceneManager.LoadScene(2); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Checkpoint")) { currentCheckPoint = other.transform; healRate = 5; saveAndLoad.BinarySave(); } }