using System;
using MaidStatus;
using UnityEngine;

public class YotogiSkillLockUnit : MonoBehaviour
{
	public YotogiSkillData skillData { get; private set; }

	public new bool enabled
	{
		get
		{
			return this.checkBox.enabled;
		}
		set
		{
			if (!value)
			{
				this.checkBox.check = false;
			}
			this.checkBox.enabled = value;
			if (value)
			{
				this.checkBox.CheckMarkOffObject.GetComponent<UISprite>().color = new Color(1f, 1f, 1f, 0.5f);
			}
			else
			{
				this.checkBox.CheckMarkOffObject.GetComponent<UISprite>().color = new Color(0.5f, 0.5f, 0.5f, 0.5f);
			}
		}
	}

	public void Awake()
	{
		NDebug.AssertNull(this.checkBox);
		this.checkBox.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBox));
	}

	public void SetSkillData(YotogiSkillData skillData)
	{
		this.skillData = skillData;
		if (skillData == null)
		{
			WFCheckBox wfcheckBox = this.checkBox;
			bool flag = false;
			this.checkBox.check = flag;
			wfcheckBox.enabled = flag;
			this.checkBox.CheckMarkOffObject.GetComponent<UISprite>().color = new Color(0.5f, 0.5f, 0.5f, 0.5f);
			return;
		}
		this.checkBox.check = skillData.lockSkillExp;
	}

	public void OnClickCheckBox(WFCheckBox checkBox)
	{
		this.skillData.lockSkillExp = checkBox.check;
	}

	[SerializeField]
	public WFCheckBox checkBox;
}
