12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using MaidStatus;
- using UnityEngine;
- using wf;
- namespace Kasizuki
- {
- public class MaidPropensitysCtrl : NGUIWindow, IStatusCtrl<Maid>
- {
- protected override void Awake()
- {
- base.Awake();
- this.m_ListViewer = base.GetComponent<uGUIListViewer>();
- 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<Transform>(propensitys.Length, delegate(int index, Transform item)
- {
- Propensity.Data data = propensitys[index];
- UILabel componentInChildren2 = item.GetComponentInChildren<UILabel>();
- componentInChildren2.text = data.drawName;
- Utility.SetLocalizeTerm(componentInChildren2, data.termName, false);
- });
- UIGrid component = this.m_ListViewer.parentItemArea.GetComponent<UIGrid>();
- component.enabled = true;
- component.Reposition();
- UIScrollView componentInChildren = base.GetComponentInChildren<UIScrollView>();
- componentInChildren.ResetPosition();
- }
- private uGUIListViewer m_ListViewer;
- private Maid m_TargetMaid;
- private bool m_IsAwaked;
- }
- }
|