using System; using MaidStatus; using UnityEngine; using wf; namespace Kasizuki { public class MaidPropensitysCtrl : NGUIWindow, IStatusCtrl { protected override void Awake() { base.Awake(); this.m_ListViewer = base.GetComponent(); this.m_IsAwaked = true; } public void SetData(Maid maid) { if (maid == null) { NDebug.Warning("情報を表示するメイドにnullが指定されました。"); return; } this.m_TargetMaid = maid; this.UpdateNGUILabel(); } public void UpdateMaidInfo() { if (this.m_TargetMaid == null) { NDebug.Warning("情報を表示するメイドがnullでした。SetMaid( Maid )関数で、情報を表示するメイドを指定してください。"); return; } this.UpdateNGUILabel(); } private void UpdateNGUILabel() { if (!this.m_IsAwaked) { base.gameObject.SetActive(true); } Maid targetMaid = this.m_TargetMaid; Status status = targetMaid.status; Propensity.Data[] propensitys = status.propensitys.GetValueArray(); this.m_ListViewer.Show(propensitys.Length, delegate(int index, Transform item) { Propensity.Data data = propensitys[index]; UILabel componentInChildren2 = item.GetComponentInChildren(); componentInChildren2.text = data.drawName; Utility.SetLocalizeTerm(componentInChildren2, data.termName, false); }); UIGrid component = this.m_ListViewer.parentItemArea.GetComponent(); component.enabled = true; component.Reposition(); UIScrollView componentInChildren = base.GetComponentInChildren(); componentInChildren.ResetPosition(); } private uGUIListViewer m_ListViewer; private Maid m_TargetMaid; private bool m_IsAwaked; } }