123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using System;
- using System.Collections.Generic;
- using UnityEngine;
- using wf;
- namespace Kasizuki
- {
- public class MaidLikabilityCtrl : 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);
- }
- KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
- Maid maid = this.m_TargetMaid;
- List<ManData.Data> manList = ManData.GetAllDatas(true, true);
- this.m_ListViewer.Show<Transform>(manList.Count, delegate(int index, Transform item)
- {
- ManData.Data data = manList[index];
- UILabel component2 = UTY.GetChildObject(item.gameObject, "Name", false).GetComponent<UILabel>();
- UILabel component3 = UTY.GetChildObject(item.gameObject, "Value", false).GetComponent<UILabel>();
- UISprite component4 = UTY.GetChildObject(item.gameObject, "Gauge/Gauge", false).GetComponent<UISprite>();
- int num = 0;
- ManDataType manType = data.manType;
- if (manType != ManDataType.主人公)
- {
- if (manType != ManDataType.傅き男1)
- {
- if (manType != ManDataType.傅き男2)
- {
- if (manType != ManDataType.傅き男3)
- {
- if (manType != ManDataType.傅き男4)
- {
- if (manType == ManDataType.傅き男5)
- {
- num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男5, false);
- }
- }
- else
- {
- num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男4, false);
- }
- }
- else
- {
- num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男3, false);
- }
- }
- else
- {
- num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男2, false);
- }
- }
- else
- {
- num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男1, false);
- }
- }
- else
- {
- num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F本編, false);
- }
- num = Mathf.Clamp(num, 0, 100);
- component2.text = data.drawName;
- Utility.SetLocalizeTerm(component2, data.drawNameTerm);
- component3.text = num.ToString();
- component4.fillAmount = (float)num / 100f;
- });
- 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;
- }
- }
|