Hello, JesseEtzler0 is doing new tutorial series how to make skills. It is pretty easy so far, but I was trying to make it in C# but I failed.
Simply, he made a class with variables like skillName, skillDescription etc. and then he made a new script where he made an array of this class properties, like var Skills : skills where “skills” is a name of class. Then he just simply defined these skill variables in the inspector. Is there any way how to make it in C#? I tried to make it like this:
using UnityEngine;
public class Skill {
private string _name;
private string _description;
private int _requiredPoints;
private int _addedPoints;
private bool _hasLearnt;
public Skill() {
_name = "Enter name of the skill here.";
_description = "Describe the skill here.";
_requiredPoints = 1;
_addedPoints = 0;
_hasLearnt = false;
}
#region Getters and Setters of Skill class
public string Name {
get { return _name; }
set { _name = value; }
}
public string Description
{
get { return _description; }
set { _description = value; }
}
public int RequiredPoints
{
get { return _requiredPoints; }
set { _requiredPoints = value; }
}
public int AddedPoints
{
get { return _addedPoints; }
set { _addedPoints = value; }
}
public bool HasLearnt
{
get { return _hasLearnt; }
set { _hasLearnt = value; }
}
#endregion
}
And then I made a new script called Skills wherein I was trying to make mentioned array of class, but everything I was trying failed.