using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using TMPro;
    
    public class SpriteText : MonoBehaviour
    {
        [SerializeField]
        GameObject boxObject;
    
        Box box;
        TextMeshProUGUI text; 
    
        // Start is called before the first frame update
        void Start()
        {
            box = boxObject.GetComponent<Box>();
            text = gameObject.GetComponent<TextMeshProUGUI>();
        }
    
        // Update is called once per frame
        void Update()
        {
        
        }
    
        void FixedUpdate()
        {
            text.text = box.sText;
        }
    }