-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindPrefScript.cs
More file actions
51 lines (45 loc) · 1.24 KB
/
FindPrefScript.cs
File metadata and controls
51 lines (45 loc) · 1.24 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
48
49
50
51
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class FindPrefScript : MonoBehaviour
{
public GameObject findPref;
public TMP_Text value;
public Cats catss;
public void Select()
{
if (!catss.selected)
{
gameObject.GetComponent<Image>().color = new Color32(255, 139, 00, 255);
value.color = Color.white;
catss.selected = true;
AppManager.Instance.select = true;
}
else
{
gameObject.GetComponent<Image>().color = new Color32(239, 245, 249, 255);
value.color = Color.black;
catss.selected = false;
AppManager.Instance.select = false;
}
}
public void Check()
{
if (catss.selected)
{
gameObject.GetComponent<Image>().color = new Color32(255, 139, 00, 255);
value.color = Color.white;
}
else
{
gameObject.GetComponent<Image>().color = new Color32(239, 245, 249, 255);
value.color = Color.black;
}
}
public void CreatePref(string name, Cats cats)
{
value.text = name;
catss= cats;
Check();
}
}