|
@@ -13,9 +13,14 @@ public class SPJKLayer : MonoBehaviour
|
|
public List<SPJK_ObsItem> currentObsDataList = new List<SPJK_ObsItem>();
|
|
public List<SPJK_ObsItem> currentObsDataList = new List<SPJK_ObsItem>();
|
|
|
|
|
|
public Text countText;
|
|
public Text countText;
|
|
|
|
+
|
|
|
|
+ public InputField _obsSearchInputField;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
void Start()
|
|
void Start()
|
|
{
|
|
{
|
|
|
|
+
|
|
ObsData[] obs = GlobalData.obsDatas.ToArray();
|
|
ObsData[] obs = GlobalData.obsDatas.ToArray();
|
|
for (int i = 0; i < obs.Length; i++)
|
|
for (int i = 0; i < obs.Length; i++)
|
|
{
|
|
{
|
|
@@ -24,5 +29,25 @@ public class SPJKLayer : MonoBehaviour
|
|
currentObsDataList.Add(tempItem);
|
|
currentObsDataList.Add(tempItem);
|
|
}
|
|
}
|
|
countText.text = $"监控列表 (<color=#FFFFFF>{obs.Length}</color>)";
|
|
countText.text = $"监控列表 (<color=#FFFFFF>{obs.Length}</color>)";
|
|
|
|
+
|
|
|
|
+ _obsSearchInputField.onValueChanged.AddListener(SearchObsItem);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void SearchObsItem(string s_name)
|
|
|
|
+ {
|
|
|
|
+ if (s_name.Equals(""))
|
|
|
|
+ {
|
|
|
|
+ for (int i = 0; i < currentObsDataList.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ currentObsDataList[i].gameObject.SetActive(true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ for (int i = 0; i < currentObsDataList.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ currentObsDataList[i].gameObject.SetActive(currentObsDataList[i]._data.name.Contains(s_name));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|