Hello community,
i am new to unity and c# and like to know how to accomplish the following:
public void SpentPoints(string attrib_amount)
{
string[] splitted = attrib_amount.Split(':');
string attribute = FirstLetterToUpper(splitted[0]);
string t_amount = splitted[1];
int amount;
int.TryParse(t_amount, out amount);
if (newPlayer.PlayerClass != null)
{
if (amount > 0 && pointsToSpent > 0)
{
newPlayer.attribute = attribute + amount; // <---- PROBLEM
pointsToSpent = pointsToSpent.amount;
}
}
}
Assets/Scripts/Stats/CreatePlayer.cs(134,27): error CS1061: Type BasePlayerClass' does not contain a definition for attribute’ and no extension method attribute' of type BasePlayerClass’ could be found…
Would be nice if someone can point me to the right direction.
Greets R.