Делаю аркадку на Unity и решил сделать счетчик очков. Очки будут прибавляться ежесекундно и выводиться на стандартном канвасе, но возникает эта ошибка:
Assets\Scripts\Points.cs(31,13): error CS0019: Operator '+=' cannot be applied to operands of type 'Text' and 'float'
Помогите пожалуйста, как это исправить?
Код:
public Text points;
float quantity = 0f;
public void Start()
{
StartCoroutine(Work());
}
public void Update()
{
points.text = "" + quantity;
if(Obstacles.isLose == true)
{
StopCoroutine(Work());
}
}
IEnumerator Work()
{
while(true)
{
yield return new WaitForSeconds(1.0f);
points += 1f;
}
}