KaiClavier

STMTextSend.cs

Jul 19th, 2025 (edited)
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. /*
  4.  * example script to send text to an STM object.
  5.  */
  6. [RequireComponent(typeof(SuperTextMesh))]
  7. public class STMTextSend : MonoBehaviour
  8. {
  9.     public SuperTextMesh stm;
  10.     [TextArea(3,10)]
  11.     public string text;
  12.     public void OnValidate()
  13.     {
  14.         if(stm == null) return;
  15.         stm.text = text;
  16.     }
  17.  
  18.     public void Reset()
  19.     {
  20.         stm = GetComponent<SuperTextMesh>();
  21.         text = stm.text;
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment