コード例 #1
0
 public void SetText(string text)
 {
     if (TextComponent == null)
     {
         var cache = Application.ResourceCache;
         var node  = Node;
         TextNode      = node.CreateChild();
         TextComponent = TextNode.CreateComponent <Text3D>();
         TextComponent.HorizontalAlignment = HorizontalAlignment.Center;
         TextComponent.VerticalAlignment   = VerticalAlignment.Top;
         TextComponent.ViewMask            = 0x80000000; //hide from raycasts
         TextComponent.SetFont(cache.GetFont(Assets.Fonts.ChineseFont), 96);
         TextComponent.SetColor(Color.White);
     }
     Application.InvokeOnMain(() =>
     {
         TextComponent.SetTextFix(text);
     });
 }