72 lines
1.7 KiB
C#
72 lines
1.7 KiB
C#
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<Text>();
|
|
txt.text = name;
|
|
|
|
indexgroup = group;
|
|
indexThis = thisIndex;
|
|
}
|
|
|
|
public void SetThisOn()
|
|
{
|
|
Text txt = transform.Find("Name").GetComponent<Text>();
|
|
txt.color = new Color(.64f, 0, .44f);
|
|
|
|
GetComponent<Image>().sprite = CustomizeZoe_Screen.instance.sprChosen;
|
|
}
|
|
|
|
public bool CheckBlockStatus()
|
|
{
|
|
return blocked;
|
|
}
|
|
|
|
public void SetThisOff()
|
|
{
|
|
Text txt = transform.Find("Name").GetComponent<Text>();
|
|
txt.color = Color.white;
|
|
|
|
GetComponent<Image>().sprite = CustomizeZoe_Screen.instance.sprNotChosen;
|
|
}
|
|
|
|
public void Unblock()
|
|
{
|
|
blocked = false;
|
|
Image img = GetComponent<Image>();
|
|
img.color = Color.white;
|
|
}
|
|
|
|
public void SetThisBlocked()
|
|
{
|
|
Text txt = transform.Find("Name").GetComponent<Text>();
|
|
txt.color = new Color(.64f, 0, .44f);
|
|
|
|
Image img = GetComponent<Image>();
|
|
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);
|
|
}
|
|
}
|
|
}
|