Why can't I assign a value to the array in the class "Player"?
DataBridge: MonoBehaivor class
data = new Player(SignupUsernameInput.text, SignupPasswordInput.text, Coins, highScore, racketsOwned[0] = RacketsOwned[0], backroundsOwned[0] = BackroundsOwned[0], ballsOwned[0] = BallsOwned[0]);
data = new Player(SignupUsernameInput.text, SignupPasswordInput.text, Coins, highScore,racketsOwned[0] = "true", backroundsOwned[0] = "true", ballsOwned[0] = "true");
[Serializable] public class Player {
public string Username;
public string Password;
public int Coins;
public int highScore;
public string[] RacketsOwned;
public string[] BackroundsOwned;
public string[] BallsOwned;
public Player(string name, string pass, int coins, int HighScore, string[] racketsOwned, string[] backroundsOwned, string[] ballsOwned) {
Username = name;
Password = pass;
Coins = coins;
highScore = HighScore;
for (int i = 0; i < racketsOwned.Length; i++)
{
RacketsOwned[i] = racketsOwned[i];
}
for (int i = 0; i < backroundsOwned.Length; i++)
{
BackroundsOwned[i] = backroundsOwned[i];
}
for (int i = 0; i < ballsOwned.Length; i++)
{
BallsOwned[i] = ballsOwned[i];
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Dynamic buttons with an array from firebase URL links 0 Answers
How to compare a position of an object within an array 1 Answer
[SOLVED] Increase and Decrease size of Class Array in Unity C# 1 Answer
Managing In-Game Variables of Different Data Types 1 Answer
Custom inspector for items in array 1 Answer