1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using System;
- using System.Collections.Generic;
- using MaidStatus;
- using UnityEngine;
- public class AttributeViewer : MonoBehaviour
- {
- public void Awake()
- {
- if (this.seiheki_table_ != null)
- {
- return;
- }
- this.updateStatusInfo = false;
- this.seiheki_table_ = UTY.GetChildObject(base.gameObject, "Contents/Attribute/AttributeUnitParent", false).GetComponent<UITable>();
- List<Transform> childList = this.seiheki_table_.GetChildList();
- for (int i = 0; i < childList.Count; i++)
- {
- childList[i].gameObject.SetActive(false);
- }
- this.seiheki_table_.Reposition();
- }
- public void OnEnable()
- {
- this.UpdateStatusInfo();
- }
- public void UpdateStatusInfo()
- {
- this.Awake();
- if (this.updateStatusInfo)
- {
- return;
- }
- this.updateStatusInfo = true;
- Status status = GameMain.Instance.CharacterMgr.GetMaid(0).status;
- List<Transform> childList = this.seiheki_table_.GetChildList();
- for (int i = 0; i < childList.Count; i++)
- {
- childList[i].gameObject.SetActive(false);
- }
- int num = 0;
- foreach (Propensity.Data data in status.propensitys.GetValueArray())
- {
- if (childList.Count <= num)
- {
- break;
- }
- childList[num].gameObject.SetActive(true);
- UILabel componentInChildren = childList[num].gameObject.GetComponentInChildren<UILabel>();
- if (!(componentInChildren == null))
- {
- componentInChildren.text = data.drawName;
- num++;
- }
- }
- }
- private Maid maid_;
- private UITable seiheki_table_;
- private bool updateStatusInfo;
- }
|