Выдает ошибку:
NullReferenceException: Object reference not set to an instance of an object
BoxController.OpenBox (System.Int32 BoxId) (at Assets/Scripts/BoxController.cs:171)
В последней строке
Код:
if(player.PlayerBrawlers.Count != 0)
{
int RandomBrawler = Random.Range(0, player.PlayerBrawlers.Count);
int PowerPointsAmount = Random.Range(ThisBox.PPAmount.x, ThisBox.PPAmount.y);
player.PlayerBrawlers[RandomBrawler].PowerPoints += PowerPointsAmount;
Drop.PowerPoints.Add(new PowerPoint() { brawler = player.PlayerBrawlers[RandomBrawler], PowerPointsAmount = PowerPointsAmount});
}