using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class CustomizeOption : MonoBehaviour { public int indexgroup, indexThis; bool chosen, blocked = false; public void SetInfo(string name, bool chosen, int group, int thisIndex) { Text txt = GetComponentInChildren(); txt.text = name; indexgroup = group; indexThis = thisIndex; } public void SetThisOn() { Text txt = transform.Find("Name").GetComponent(); txt.color = new Color(.64f, 0, .44f); GetComponent().sprite = CustomizeZoe_Screen.instance.sprChosen; } public bool CheckBlockStatus() { return blocked; } public void SetThisOff() { Text txt = transform.Find("Name").GetComponent(); txt.color = Color.white; GetComponent().sprite = CustomizeZoe_Screen.instance.sprNotChosen; } public void Unblock() { blocked = false; Image img = GetComponent(); img.color = Color.white; } public void SetThisBlocked() { Text txt = transform.Find("Name").GetComponent(); txt.color = new Color(.64f, 0, .44f); Image img = GetComponent(); img.sprite = CustomizeZoe_Screen.instance.sprChosen; img.color = new Color(0.2830189f, 0.02f, 0.1996306f); blocked = true; } public void ChooseThis() { if (!blocked) { CustomizeZoe_Screen.instance.ChoseThisOne(indexgroup, indexThis); } else { CustomizeZoe_Screen.instance.ChooseToBuyItem(indexgroup, indexThis); } } }