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.
50 lines
1.5 KiB
50 lines
1.5 KiB
using UnityEngine; |
|
using System.Collections; |
|
using UnityEngine.UI; |
|
using UnityEngine.EventSystems; |
|
using AX.TrackRecord; |
|
using AX.MessageSystem; |
|
|
|
public class TeamDropDown : MonoBehaviour { |
|
|
|
private Dropdown SubordinateName; |
|
public static TeamDropDown Instance; |
|
|
|
void Awake() |
|
{ |
|
if (Instance == null) |
|
{ |
|
Instance = this; |
|
} |
|
} |
|
void Start () |
|
{ |
|
SubordinateName = this.GetComponent<Dropdown>(); |
|
} |
|
|
|
public void GetTeam() |
|
{ |
|
SubordinateName.options.Clear(); |
|
for (int i = 0; i < RecordManager.Instance.record.Teamquantity.TeamList.Count; i++) |
|
{ |
|
Dropdown.OptionData OptionData = new Dropdown.OptionData(); |
|
OptionData.text = RecordManager.Instance.record.Teamquantity.TeamList[i].TeamName; |
|
SubordinateName.options.Add(OptionData); |
|
} |
|
SubordinateName.interactable = true; |
|
} |
|
public void OnValeChange() |
|
{ |
|
for (int i = 0; i < RecordManager.Instance.record.Teamquantity.TeamList.Count; i++) |
|
{ |
|
string Team = RecordManager.Instance.record.Teamquantity.TeamList[i].TeamName; |
|
|
|
if (Team.Equals(SubordinateName.options[SubordinateName.value].text)) |
|
{ |
|
string name = "PowerAttributeUI"; |
|
MessageDispatcher.SendMessage("OPEN", (object)name, "CUBE"); |
|
SetPowerScript.Instance.InstanceItem(RecordManager.Instance.record.Teamquantity.TeamList[i]); |
|
} |
|
} |
|
} |
|
}
|
|
|