Thank you for the answer.
this is the Progression.cs code:
[CreateAssetMenu(fileName = "Progression", menuName = "Stats/Progression", order = 0)]
public class Progression : ScriptableObject
{
[SerializeField] ProgressionCharacterClass[] characterClasses;
public float GetHealth(CharacterClass characterClass, int level)
{
foreach (ProgressionCharacterClass progressionclass in characterClasses)
{
if (progressionclass.characterClass == characterClass)
{
return progressionclass.health[level - 1];
}
}
return 0;
}
[System.Serializable]
class ProgressionCharacterClass
{
public CharacterClass characterClass;
public int[] health;
}
}
What I’m trying to fix is that when I drag the scriptable object from the assets folder into visual studio, it gives me the result that I posted rather than the one Sam has in his video, where you can clearly see all the values and modify the asset file in visual studio. This is how it should have looked like when I dragged it into visual studio:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c99bf0e04b0f91345a423dd97462b910, type: 3}
m_Name: Progression
m_EditorClassIdentifier:
characterClasses:
- characterClass: 0
health:
- 50
- 100
- 200
- 400
- 700
- characterClass: 1
health:
- 40
- characterClass: 3
health:
- 30
So what I read online is that mine looks different for some some saving issues that Unity has with the scriptable objects and some solutions talk about creating a custom inspector, but with my current level I have no idea what it is about. Thank you in advance for the help.