using System; using MaidStatus; using UnityEngine; using wf; public class ClassUnit : MonoBehaviour { public void Awake() { this.button_ = base.GetComponentInChildren(); this.class_name_ = UTY.GetChildObject(base.gameObject, "ClassName", false).GetComponent(); this.class_level_ = UTY.GetChildObject(base.gameObject, "Level/Value", false).GetComponent(); EventDelegate.Add(this.button_.onSelect, new EventDelegate.Callback(this.OnSelect)); this.job_class_type_ = (this.yotogi_class_type_ = int.MinValue); } public void SetOnSelectEvent(Action event_delgate) { this.select_event_ = event_delgate; } public void SetClassChangePanel(ClassChangePanel class_change_panel) { this.class_change_panel_ = class_change_panel; } public void UpdateMaidData(Maid maid) { if (this.job_class_type_ != -2147483648) { if (maid.status.jobClass.Contains(this.job_class_type_)) { ClassData classData = maid.status.jobClass.Get(this.job_class_type_); this.class_level_.text = classData.level.ToString(); this.class_level_.transform.parent.gameObject.SetActive(true); } else { this.class_level_.transform.parent.gameObject.SetActive(false); } } else if (this.yotogi_class_type_ != -2147483648) { if (maid.status.yotogiClass.Contains(this.yotogi_class_type_)) { ClassData classData2 = maid.status.yotogiClass.Get(this.yotogi_class_type_); this.class_level_.text = classData2.level.ToString(); this.class_level_.transform.parent.gameObject.SetActive(true); } else { this.class_level_.transform.parent.gameObject.SetActive(false); } } } public void SetJobClassType(int class_type) { this.yotogi_class_type_ = int.MinValue; this.job_class_type_ = class_type; JobClass.Data data = JobClass.GetData(class_type); this.class_name_.text = data.drawName; this.class_level_.text = "0"; Utility.SetLocalizeTerm(this.class_name_, data.termName); } public void SetYotogiClassType(int class_type) { this.job_class_type_ = int.MinValue; this.yotogi_class_type_ = class_type; this.class_name_.text = YotogiClass.GetData(class_type).drawName; this.class_level_.text = "0"; } public void UpdateInfo() { if (this.job_class_type_ != -2147483648) { this.class_change_panel_.SetInfoData(this.job_class_type_); } else if (this.yotogi_class_type_ != -2147483648) { this.class_change_panel_.SetInfoDataYotogi(this.yotogi_class_type_); } } private void OnSelect() { if (this.select_event_ != null && this.button_.isSelected) { this.select_event_(this); } } public int maid_class_type { get { return this.job_class_type_; } } public int yotogi_class_type { get { return this.yotogi_class_type_; } } public UIWFTabButton button { get { return this.button_; } } public UIWFTabPanel tab_panel { get { return this.tab_panel_; } } private Action select_event_; private UIWFTabPanel tab_panel_; private UIWFTabButton button_; private UILabel class_name_; private UILabel class_level_; private int job_class_type_; private int yotogi_class_type_; private ClassChangePanel class_change_panel_; }