/// <summary> /// Loads the data for the persistant controller and applies the save data to runtime /// </summary> /// <param name="persistCont">PersistantController that will recieve the data </param> public static void LoadPersistantController(PersistantController persistCont) { // Get the save data PersistantFloorData persistFloorData = SaveSystem.LoadPersistantFloorData(); // Set the values of the PersistantController persistCont.SetNextFloorDifficulty(persistFloorData.GetNextFloorDifficulty()); persistCont.SetNextFloorNum(persistFloorData.GetNextFloor()); PersistantController.SetPotCharges(persistFloorData.GetPotCharges()); }
// Gets character selected using the event and changes allyIndex to match the character selected character private void CharacterToHeal(MoveAttack charMA) { if (charMA.WhatAmI == CharacterType.Ally && _isHolding == true) { // reduces the charges PersistantController.SetPotCharges(PersistantController.GetPotCharges() - 1); _allyToHeal = charMA.GetComponent <AllyHealth>(); if (_allyToHeal == null) { Debug.LogError("No AllyHealth attached to " + _allyToHeal.name); } HealCharacter(); _isHolding = false; } }
//refills potion back to three public void RefillPotion() { PersistantController.SetPotCharges(3); _update = true; Debug.Log("Potions have been refilled"); }