Я не могу отобразить счет на моей winPanel на холсте.
Кодирование и интерфейс счета, которые отображаются на игровой сцене: -
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class getscore : MonoBehaviour
{
public GameObject scoretext;
private void Start()
{
scoretext.GetComponent<Text>().text = "0";
}
public void setscore(float scoretoadd)
{
float currentscore = float.Parse(scoretext.GetComponent<Text>().text);
float newscore = currentscore + scoretoadd;
scoretext.GetComponent<Text>().text = newscore.ToString("F0");
}
}

Затем я помещаю ту же кодировку в холст, где предполагается, что на моем холсте winPanel отображается счет: -

Выводгде счет отображается только на игровой сцене, но не отображается на моей winPanel на холсте: -

Проблема сейчас в том, почему счетне отображается на моем холсте winPanel?