这里有人是绞刑架。 我有以下问题。我有两个班。 .a类ListPainel。 和类项目要求。使变量值A = B统一
类ListPainel我有以下几点:
[System.Serializable]
public class Item
{
public GameObject slotPrafab;
public int numeroDeItensDisp;
public int numeroDeItensTotal;
}
public List<Item> itemList;
等等...
,并在课堂上RequirementsItems我有以下几点: 只有公共变量,这样我可以在检查变更统一。
public Sprite imageNewItem;
public Image imageItem;
public Text req;
public string barra;
public int numberReqDisp;
public int numberReqTotal;
public static Item painel;
等等...
,我需要的变量/ numberReqDisp的价值; be =项目数量;类listPainel ...所以我会这样欺骗:
numberReqDisp = painel.numeroDeItensDisp;
会发生什么事。在我的团结。值不会改变。并且它给出错误“对象引用未设置为对象的实例”
..并且明确所需的类别项目被附加到预制。 “
我投票结束这个问题作为题外话,因为它是葡萄牙语 –
对不起,我忘了翻译。我不会说英语 –
使用堆栈溢出时间:葡萄牙语:) –