天津23维预案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
831 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AX.MessageSystem;
using AX.TrackRecord;
public class LoadNameText : MonoBehaviour {
private TextMesh Nametext;
private void Awake()
{
Nametext = GetComponent<TextMesh>();
MessageDispatcher.AddListener("LoadTextMesh", loadTextMesh);
}
public void loadTextMesh(IMessage mes)
{
ObjAttribute oriObj = (ObjAttribute)mes.Data;
if (oriObj.ObjName == gameObject.name)
{
Nametext.color = oriObj.jijiequ.color;
Nametext.text = oriObj.jijiequ.Name;
Nametext.gameObject.transform.localScale = oriObj.trans.scale;
}
}
private void OnDestroy()
{
MessageDispatcher.RemoveListener("LoadTextMesh", loadTextMesh);
}
}