GAME DEVING AT 3 AM CHALLENGE (I ALMOST DIED)
This commit is contained in:
parent
c2a71d5188
commit
9930aba85d
3428 changed files with 186147 additions and 2298 deletions
36
Assets/Scripts/AbilitySceneTransfer.cs
Normal file
36
Assets/Scripts/AbilitySceneTransfer.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class AbilitySceneTransfer : MonoBehaviour
|
||||
{
|
||||
#region Statication
|
||||
|
||||
public static AbilitySceneTransfer instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance != null && instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
[System.Serializable]
|
||||
public class SavedAbility
|
||||
{
|
||||
public string abilityName;
|
||||
public Dictionary<string, int> equippedUpgrades;
|
||||
}
|
||||
public List<SavedAbility> savedAbilities;
|
||||
public void SaveAbility(PlayerAbility savedAbility)
|
||||
{
|
||||
savedAbilities.Add(new SavedAbility
|
||||
{
|
||||
abilityName = savedAbility.abilityName
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue