-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFonFindScript.cs
More file actions
47 lines (41 loc) · 1.11 KB
/
FonFindScript.cs
File metadata and controls
47 lines (41 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using TMPro;
using UnityEngine;
public class FonFindScript : MonoBehaviour
{
public TMP_InputField value;
public GameObject findPref;
public GameObject ParentFindPref;
public void OnEnable()
{
AppManager.Instance.BottomBar.SetActive(false);
AppManager.Instance.searching = "";
ClearAllCells();
InstanceFindPref();
}
public void ReturnBottom()
{
AppManager.Instance.BottomBar.SetActive(true);
}
public void InstanceFindPref()
{
var res = AppManager.Instance.res;
for (int i = 0; i < res.cats.Count; i++)
{
var dish = Instantiate(findPref, ParentFindPref.transform);
dish.GetComponent<FindPrefScript>().CreatePref(res.cats[i].name, res.cats[i]);
}
}
public void ClearAllCells()
{
ParentFindPref.transform.ClearChildren();
}
public void Search()
{
var AM = AppManager.Instance;
if (value.text != "")
{
AM.searching = value.text;
}
AM.SwitchScreen(17);
}
}