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.
44 lines
1.1 KiB
44 lines
1.1 KiB
using UnityEngine; |
|
|
|
|
|
/// <summary> |
|
/// 查看信息类型,车或者是人。 |
|
/// </summary> |
|
public enum MessageType |
|
{ |
|
CharacterMessage, |
|
TruckMessage |
|
} |
|
public class TopNameButton : BaseButton |
|
{ |
|
public GameObject obj; |
|
public MessageType mMessageType; |
|
//private GameObject MessageParent; |
|
|
|
|
|
public override void RespondFun() |
|
{ |
|
if (mMessageType == MessageType.CharacterMessage) |
|
{ |
|
CharacterMessagePanel.Instance.SetUI(obj); |
|
} |
|
if (mMessageType == MessageType.TruckMessage) |
|
{ |
|
TruckMessagePanel.Instance.SetUI(obj); |
|
} |
|
} |
|
|
|
|
|
void Start () { |
|
obj = GetComponent<UINameItem>().Target; |
|
if (obj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.Character || obj.GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.fireman) |
|
{ |
|
mMessageType = MessageType.CharacterMessage; |
|
} |
|
else |
|
{ |
|
mMessageType = MessageType.TruckMessage; |
|
} |
|
//MessageParent = GameObject.Find("Canvas/MessageParent"); |
|
} |
|
}
|
|
|