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.
35 lines
814 B
35 lines
814 B
using UnityEngine; |
|
using System.Collections; |
|
using UnityEngine.UI; |
|
using AX.MessageSystem; |
|
|
|
public class UserSelectMessage : MonoBehaviour { |
|
|
|
// Use this for initialization |
|
public UserInfo user; |
|
void Start() |
|
{ |
|
GetComponent<Toggle>().onValueChanged.AddListener(changeList); |
|
} |
|
void OnDestroy() |
|
{ |
|
GetComponent<Toggle>().onValueChanged.RemoveListener(changeList); |
|
} |
|
// Update is called once per frame |
|
void Update() |
|
{ |
|
|
|
} |
|
public void setUser(UserInfo user) |
|
{ |
|
this.user = user; |
|
transform.Find("Label").GetComponent<Text>().text = user.Name; |
|
} |
|
private void changeList(bool selected) |
|
{ |
|
if (selected) |
|
{ |
|
MessageDispatcher.SendMessage("CHANGE_USER_REFRESH", user); |
|
} |
|
} |
|
}
|
|
|